{"version":3,"file":"charts-VWliGDqy.js","sources":["../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/coordinate/cartesian.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/utils/angle.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/coordinate/polar.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/coordinate/transpose.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/coordinate/theta.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/coordinate/radial.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/coordinate/parallel.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/coordinate/fisheye.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/coordinate/radar.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/encode/constant.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/encode/transform.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/encode/field.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/encode/column.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/is-array-like.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/filter.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/is-function.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/is-nil.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/is-type.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/is-array.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/is-object.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/each.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/keys.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/is-match.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/is-object-like.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/is-plain-object.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/find.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/max.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/min.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/reduce.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/is-string.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/last.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/clamp.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/is-number.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/is-number-equal.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/max-by.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/min-by.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/mod.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/to-string.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/lower-first.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/substitute.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/upper-first.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/is-boolean.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/is-undefined.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/mix.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/clone.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/debounce.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/memoize.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/deep-mix.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/is-equal.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/get.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/set.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/pick.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/omit.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/throttle.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/noop.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/lodash/size.js","../../../../.yarn/cache/gl-matrix-npm-3.4.3-f2e6349faa-25ca2f7c76.zip/node_modules/gl-matrix/esm/common.js","../../../../.yarn/cache/gl-matrix-npm-3.4.3-f2e6349faa-25ca2f7c76.zip/node_modules/gl-matrix/esm/mat3.js","../../../../.yarn/cache/gl-matrix-npm-3.4.3-f2e6349faa-25ca2f7c76.zip/node_modules/gl-matrix/esm/mat4.js","../../../../.yarn/cache/gl-matrix-npm-3.4.3-f2e6349faa-25ca2f7c76.zip/node_modules/gl-matrix/esm/vec3.js","../../../../.yarn/cache/gl-matrix-npm-3.4.3-f2e6349faa-25ca2f7c76.zip/node_modules/gl-matrix/esm/vec4.js","../../../../.yarn/cache/gl-matrix-npm-3.4.3-f2e6349faa-25ca2f7c76.zip/node_modules/gl-matrix/esm/quat.js","../../../../.yarn/cache/gl-matrix-npm-3.4.3-f2e6349faa-25ca2f7c76.zip/node_modules/gl-matrix/esm/vec2.js","../../../../.yarn/cache/tslib-npm-2.6.2-4fc8c068d9-bd26c22d36.zip/node_modules/tslib/tslib.es6.mjs","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/parser/params-parser.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/process/fix-arc.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/parser/params-count.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/util/is-path-array.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/util/is-absolute-array.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/util/is-normalized-array.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/parser/finalize-segment.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/parser/scan-flag.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/parser/is-digit-start.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/parser/scan-param.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/parser/is-space.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/parser/skip-spaces.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/parser/is-path-command.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/parser/is-arc-command.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/parser/scan-segment.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/parser/path-parser.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/parser/parse-path-string.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/convert/path-2-absolute.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/process/normalize-segment.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/process/normalize-path.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/util/is-curve-array.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/util/rotate-vector.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/process/arc-2-cubic.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/process/quad-2-cubic.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/util/mid-point.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/process/line-2-cubic.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/process/segment-2-cubic.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/convert/path-2-curve.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/process/clone-path.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/process/reverse-curve.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/util/distance-square-root.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/util/segment-line-factory.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/util/segment-arc-factory.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/util/segment-cubic-factory.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/util/segment-quad-factory.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/util/path-length-factory.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/util/get-total-length.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/util/get-rotated-curve.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/util/get-path-area.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/util/get-draw-direction.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/util/get-point-at-length.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/path/util/equalize-segments.js","../../../../.yarn/cache/@antv-util-npm-3.3.6-3d5d8f5104-4de0e6e3d8.zip/node_modules/@antv/util/esm/dom/create-dom.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/utils/helper.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/maybeZeroY1.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/ascending.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/descending.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/bisector.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/number.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/bisect.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/count.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/variance.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/deviation.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/extent.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/fsum.js","../../../../.yarn/cache/internmap-npm-2.0.3-d74f5c9998-873e0e7fcf.zip/node_modules/internmap/src/index.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/identity.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/group.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/permute.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/sort.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/groupSort.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/array.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/constant.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/ticks.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/nice.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/threshold/sturges.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/bin.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/max.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/maxIndex.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/min.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/minIndex.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/quickselect.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/greatest.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/quantile.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/threshold/scott.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/mean.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/median.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/merge.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/range.js","../../../../.yarn/cache/d3-array-npm-3.2.4-b427632bcc-5800c467f8.zip/node_modules/d3-array/src/sum.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/utils/helper.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/utils/array.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/utils/order.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/stackY.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/utils/dateFormat.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/maybeTitle.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/maybeZeroX.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/maybeZeroY.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/maybeSize.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/maybeKey.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/maybeSeries.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/maybeTupleY.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/maybeTupleX.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/maybeIdentityY.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/maybeIdentityX.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/maybeDefaultX.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/maybeDefaultY.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/maybeTooltip.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/maybeZeroPadding.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/maybeVisualPosition.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/maybeFunctionAttribute.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/maybeTuple.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/maybeGradient.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/dodgeX.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/stackEnter.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/normalizeY.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/utils/compose.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/utils/normalize.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/utils/clamp.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/utils/bisect.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/utils/ticks.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/utils/d3-linear-nice.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/utils/time-interval.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/utils/utc-interval.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/utils/find-tick-interval.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/utils/d3-time-nice.js","../../../../.yarn/cache/@antv-util-npm-2.0.17-d855f43b5b-15cad6cafb.zip/node_modules/@antv/util/esm/is-array-like.js","../../../../.yarn/cache/@antv-util-npm-2.0.17-d855f43b5b-15cad6cafb.zip/node_modules/@antv/util/esm/is-type.js","../../../../.yarn/cache/@antv-util-npm-2.0.17-d855f43b5b-15cad6cafb.zip/node_modules/@antv/util/esm/is-function.js","../../../../.yarn/cache/@antv-util-npm-2.0.17-d855f43b5b-15cad6cafb.zip/node_modules/@antv/util/esm/is-nil.js","../../../../.yarn/cache/@antv-util-npm-2.0.17-d855f43b5b-15cad6cafb.zip/node_modules/@antv/util/esm/is-array.js","../../../../.yarn/cache/@antv-util-npm-2.0.17-d855f43b5b-15cad6cafb.zip/node_modules/@antv/util/esm/is-object.js","../../../../.yarn/cache/@antv-util-npm-2.0.17-d855f43b5b-15cad6cafb.zip/node_modules/@antv/util/esm/each.js","../../../../.yarn/cache/@antv-util-npm-2.0.17-d855f43b5b-15cad6cafb.zip/node_modules/@antv/util/esm/is-object-like.js","../../../../.yarn/cache/@antv-util-npm-2.0.17-d855f43b5b-15cad6cafb.zip/node_modules/@antv/util/esm/is-plain-object.js","../../../../.yarn/cache/@antv-util-npm-2.0.17-d855f43b5b-15cad6cafb.zip/node_modules/@antv/util/esm/is-string.js","../../../../.yarn/cache/@antv-util-npm-2.0.17-d855f43b5b-15cad6cafb.zip/node_modules/@antv/util/esm/is-number.js","../../../../.yarn/cache/@antv-util-npm-2.0.17-d855f43b5b-15cad6cafb.zip/node_modules/@antv/util/esm/values.js","../../../../.yarn/cache/@antv-util-npm-2.0.17-d855f43b5b-15cad6cafb.zip/node_modules/@antv/util/esm/is-null.js","../../../../.yarn/cache/@antv-util-npm-2.0.17-d855f43b5b-15cad6cafb.zip/node_modules/@antv/util/esm/is-undefined.js","../../../../.yarn/cache/@antv-util-npm-2.0.17-d855f43b5b-15cad6cafb.zip/node_modules/@antv/util/esm/memoize.js","../../../../.yarn/cache/@antv-util-npm-2.0.17-d855f43b5b-15cad6cafb.zip/node_modules/@antv/util/esm/deep-mix.js","../../../../.yarn/cache/@antv-util-npm-2.0.17-d855f43b5b-15cad6cafb.zip/node_modules/@antv/util/esm/index-of.js","../../../../.yarn/cache/@antv-util-npm-2.0.17-d855f43b5b-15cad6cafb.zip/node_modules/@antv/util/esm/identity.js","../../../../.yarn/cache/@antv-util-npm-2.0.17-d855f43b5b-15cad6cafb.zip/node_modules/@antv/util/esm/size.js","../../../../.yarn/cache/@antv-util-npm-2.0.17-d855f43b5b-15cad6cafb.zip/node_modules/@antv/util/esm/measure-text-width.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/utils/is-valid.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/utils/log.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/utils/d3-log-nice.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/utils/interpolatize.js","../../../../.yarn/cache/color-name-npm-1.1.4-025792b0ea-b044585952.zip/node_modules/color-name/index.js","../../../../.yarn/cache/is-arrayish-npm-0.3.2-f856180f79-81a78d518e.zip/node_modules/is-arrayish/index.js","../../../../.yarn/cache/simple-swizzle-npm-0.2.2-8dee37fad1-c6dffff17a.zip/node_modules/simple-swizzle/index.js","../../../../.yarn/cache/color-string-npm-1.9.1-dc020e56be-72aa0b81ee.zip/node_modules/color-string/index.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/utils/color.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/utils/interpolate.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/utils/choose-mask.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/utils/internMap.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/scales/base.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/scales/ordinal.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/scales/band.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/tick-methods/d3-ticks.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/scales/constant.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/utils/pretty-number.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/tick-methods/wilkinson-extended.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/scales/identity.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/scales/continuous.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/scales/linear.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/scales/point.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/scales/pow.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/scales/sqrt.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/scales/threshold.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/tick-methods/d3-log.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/scales/log.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/scales/quantize.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/utils/create-quartile.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/scales/quantile.js","../../../../.yarn/cache/fecha-npm-4.2.3-75248da3fd-534ce630c8.zip/node_modules/fecha/lib/fecha.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/tick-methods/d3-time.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/scales/time.js","../../../../.yarn/cache/@antv-scale-npm-0.4.15-da68063674-4f79fd3b9a.zip/node_modules/@antv/scale/esm/scales/sequential.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/jitter.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/jitterX.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/jitterY.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/symmetryY.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/diffY.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/select.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/selectX.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/selectY.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/groupN.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/group.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/groupX.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/groupY.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/groupColor.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/sort.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/sortX.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/sortColor.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/sortY.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/flexX.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/utils/vector.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/pack.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/bin.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/binX.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/utils/lttb.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/sample.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/transform/filter.js","../../../../.yarn/cache/d3-shape-npm-3.2.0-0beb7d8b02-2e861f4d47.zip/node_modules/d3-shape/src/constant.js","../../../../.yarn/cache/d3-shape-npm-3.2.0-0beb7d8b02-2e861f4d47.zip/node_modules/d3-shape/src/math.js","../../../../.yarn/cache/d3-path-npm-3.1.0-8d69e9e4e5-8e97a9ab49.zip/node_modules/d3-path/src/path.js","../../../../.yarn/cache/d3-shape-npm-3.2.0-0beb7d8b02-2e861f4d47.zip/node_modules/d3-shape/src/path.js","../../../../.yarn/cache/d3-shape-npm-3.2.0-0beb7d8b02-2e861f4d47.zip/node_modules/d3-shape/src/arc.js","../../../../.yarn/cache/d3-shape-npm-3.2.0-0beb7d8b02-2e861f4d47.zip/node_modules/d3-shape/src/array.js","../../../../.yarn/cache/d3-shape-npm-3.2.0-0beb7d8b02-2e861f4d47.zip/node_modules/d3-shape/src/curve/linear.js","../../../../.yarn/cache/d3-shape-npm-3.2.0-0beb7d8b02-2e861f4d47.zip/node_modules/d3-shape/src/point.js","../../../../.yarn/cache/d3-shape-npm-3.2.0-0beb7d8b02-2e861f4d47.zip/node_modules/d3-shape/src/line.js","../../../../.yarn/cache/d3-shape-npm-3.2.0-0beb7d8b02-2e861f4d47.zip/node_modules/d3-shape/src/area.js","../../../../.yarn/cache/d3-shape-npm-3.2.0-0beb7d8b02-2e861f4d47.zip/node_modules/d3-shape/src/curve/radial.js","../../../../.yarn/cache/d3-shape-npm-3.2.0-0beb7d8b02-2e861f4d47.zip/node_modules/d3-shape/src/lineRadial.js","../../../../.yarn/cache/d3-shape-npm-3.2.0-0beb7d8b02-2e861f4d47.zip/node_modules/d3-shape/src/areaRadial.js","../../../../.yarn/cache/d3-shape-npm-3.2.0-0beb7d8b02-2e861f4d47.zip/node_modules/d3-shape/src/noop.js","../../../../.yarn/cache/d3-shape-npm-3.2.0-0beb7d8b02-2e861f4d47.zip/node_modules/d3-shape/src/curve/cardinal.js","../../../../.yarn/cache/d3-shape-npm-3.2.0-0beb7d8b02-2e861f4d47.zip/node_modules/d3-shape/src/curve/cardinalClosed.js","../../../../.yarn/cache/d3-shape-npm-3.2.0-0beb7d8b02-2e861f4d47.zip/node_modules/d3-shape/src/curve/catmullRom.js","../../../../.yarn/cache/d3-shape-npm-3.2.0-0beb7d8b02-2e861f4d47.zip/node_modules/d3-shape/src/curve/catmullRomClosed.js","../../../../.yarn/cache/d3-shape-npm-3.2.0-0beb7d8b02-2e861f4d47.zip/node_modules/d3-shape/src/curve/linearClosed.js","../../../../.yarn/cache/d3-shape-npm-3.2.0-0beb7d8b02-2e861f4d47.zip/node_modules/d3-shape/src/curve/monotone.js","../../../../.yarn/cache/d3-shape-npm-3.2.0-0beb7d8b02-2e861f4d47.zip/node_modules/d3-shape/src/curve/step.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/utils/coordinate.js","../../../../.yarn/cache/eventemitter3-npm-5.0.1-5e423b7df3-ac6423ec31.zip/node_modules/eventemitter3/index.js","../../../../.yarn/cache/d3-color-npm-1.4.1-cd6dccad72-f264a0ed65.zip/node_modules/d3-color/src/define.js","../../../../.yarn/cache/d3-color-npm-1.4.1-cd6dccad72-f264a0ed65.zip/node_modules/d3-color/src/color.js","../../../../.yarn/cache/@antv-g-math-npm-2.0.2-1a896a60eb-609e89b0ea.zip/node_modules/@antv/g-math/dist/index.esm.js","../../../../.yarn/cache/@antv-g-lite-npm-1.2.21-12143b5f80-e1e103b407.zip/node_modules/@antv/g-lite/dist/index.esm.js","../../../../.yarn/cache/@antv-g-camera-api-npm-1.2.22-1ad67467d9-96d37b26a9.zip/node_modules/@antv/g-camera-api/dist/index.esm.js","../../../../.yarn/cache/@antv-g-web-animations-api-npm-1.2.22-e98f94271b-3cf4e791c3.zip/node_modules/@antv/g-web-animations-api/dist/index.esm.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/utils/selection.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/utils/number.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/utils.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/interval/color.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/interval/rect.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/interval/hollow.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/interval/funnel.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/interval/pyramid.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/utils/createElement.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/line/curve.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/line/line.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/line/smooth.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/line/hv.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/line/vh.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/line/hvh.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/line/trail.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/utils/marker.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/point/color.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/point/hollowBowtie.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/point/hollowDiamond.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/point/hollowHexagon.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/point/hollow.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/point/hollowSquare.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/point/hollowTriangle.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/point/hollowTriangleDown.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/point/bowtie.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/point/cross.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/point/diamond.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/point/hexagon.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/point/hyphen.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/point/line.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/point/plus.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/point/point.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/point/square.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/point/tick.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/point/triangle.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/point/triangleDown.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/vector/vector.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/traverse.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/visibility.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/offscreen.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/shapes/Text.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/angle-converter.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/bbox.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/callback.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/classnames.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/deep-assign.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/defined.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/text.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/ellipsis.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/wrap.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/event.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/extend-display-object.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/group-by.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/if-show.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/in-range.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/interpolate.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/keyframe-interpolate.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/layout/utils/helper.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/layout/flex/index.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/layout/grid/index.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/layout/executer.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/matrix.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/number.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/omit.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/path.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/primitive.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/sampling.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/scale-to-pixel.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/group.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/selection.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/series.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/shape.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/string.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/style.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/transform.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/util/transpose.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/core/component.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/marker/symbol.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/marker/utils.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/marker/index.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/sparkline/columns.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/sparkline/lines.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/sparkline/path.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/sparkline/utils.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/sparkline/index.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/animation/utils.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/animation/fadeOut.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/slider/constant.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/slider/handle.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/slider/index.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/scrollbar/index.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/axis/constant.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/grid/index.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/axis/guides/utils.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/axis/guides/line.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/axis/guides/grid.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/axis/utils/bounds.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/axis/utils/contain.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/axis/utils/intersect.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/axis/utils/test.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/axis/overlap/autoEllipsis.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/axis/overlap/autoHide.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/axis/overlap/autoRotate.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/axis/overlap/autoWrap.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/axis/overlap/index.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/axis/utils/index.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/axis/guides/labels.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/axis/guides/ticks.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/title/index.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/axis/guides/title.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/axis/axis.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/navigator/index.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/legend/utils.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/legend/category/item.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/legend/category/items.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/legend/continuous/handle.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/legend/constant.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/legend/category.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/indicator/constant.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/indicator/indicator.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/legend/continuous/utils.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/legend/continuous/ribbon.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/legend/continuous.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/tooltip/constant.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/tooltip/index.js","../../../../.yarn/cache/@antv-component-npm-1.0.1-beta.0-90042f538d-1bcb276c4b.zip/node_modules/@antv/component/esm/ui/layout/layout.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/text/advance.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/text/text.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/text/badge.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/area/curve.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/area/area.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/area/smooth.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/area/hvh.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/area/vh.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/area/hv.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/link/link.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/link/smooth.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/link/vhv.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/link/arc.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/utils.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/image/image.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/polygon/polygon.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/polygon/ribbon.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/box/box.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/box/violin.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/lineXY/line.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/connector/connector.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/utils/string.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/label/position/area.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/label/position/default.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/label/position/outside.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/label/position/spider.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/label/position/surround.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/label/label.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/path/color.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/path/path.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/path/hollow.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/density/density.js","../../../../.yarn/cache/flru-npm-1.0.2-bb857a97f8-eb83ad6715.zip/node_modules/flru/dist/flru.mjs","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/utils/lru.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/heatmap/renderer/gradient.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/heatmap/renderer/index.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/heatmap/heatmap.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/shape/shape.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/liquid/wave.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/liquid/shapes.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/shape/liquid/liquid.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/interval.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/rect.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/line.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/point.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/text.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/cell.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/area.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/link.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/image.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/polygon.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/box.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/vector.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/lineY.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/lineX.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/connector.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/range.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/rangeX.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/rangeY.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/utils/d3-sankey/align.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/utils/d3-sankey/constant.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/utils/d3-sankey/sankey.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/sankey.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/utils/mark.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/sankey.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/utils/arc/sort.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/utils/arc/arc.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/arc.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/chord.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/path.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/cluster.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/hierarchy/count.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/hierarchy/each.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/hierarchy/eachBefore.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/hierarchy/eachAfter.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/hierarchy/find.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/hierarchy/sum.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/hierarchy/sort.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/hierarchy/path.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/hierarchy/ancestors.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/hierarchy/descendants.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/hierarchy/leaves.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/hierarchy/links.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/hierarchy/iterator.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/hierarchy/index.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/accessors.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/constant.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/lcg.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/array.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/pack/enclose.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/pack/siblings.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/pack/index.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/treemap/round.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/treemap/dice.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/partition.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/stratify.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/tree.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/treemap/slice.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/treemap/squarify.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/treemap/index.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/treemap/binary.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/treemap/sliceDice.js","../../../../.yarn/cache/d3-hierarchy-npm-3.1.2-1ac1bae7e3-497b79dc6c.zip/node_modules/d3-hierarchy/src/treemap/resquarify.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/utils/treeDataTransform.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/treemap.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/pack.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/boxplot.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/shape.js","../../../../.yarn/cache/d3-force-npm-3.0.0-462e87e63b-85945f8d44.zip/node_modules/d3-force/src/center.js","../../../../.yarn/cache/d3-quadtree-npm-3.0.1-6f0eae8c83-1915b6a7b0.zip/node_modules/d3-quadtree/src/add.js","../../../../.yarn/cache/d3-quadtree-npm-3.0.1-6f0eae8c83-1915b6a7b0.zip/node_modules/d3-quadtree/src/cover.js","../../../../.yarn/cache/d3-quadtree-npm-3.0.1-6f0eae8c83-1915b6a7b0.zip/node_modules/d3-quadtree/src/data.js","../../../../.yarn/cache/d3-quadtree-npm-3.0.1-6f0eae8c83-1915b6a7b0.zip/node_modules/d3-quadtree/src/extent.js","../../../../.yarn/cache/d3-quadtree-npm-3.0.1-6f0eae8c83-1915b6a7b0.zip/node_modules/d3-quadtree/src/quad.js","../../../../.yarn/cache/d3-quadtree-npm-3.0.1-6f0eae8c83-1915b6a7b0.zip/node_modules/d3-quadtree/src/find.js","../../../../.yarn/cache/d3-quadtree-npm-3.0.1-6f0eae8c83-1915b6a7b0.zip/node_modules/d3-quadtree/src/remove.js","../../../../.yarn/cache/d3-quadtree-npm-3.0.1-6f0eae8c83-1915b6a7b0.zip/node_modules/d3-quadtree/src/root.js","../../../../.yarn/cache/d3-quadtree-npm-3.0.1-6f0eae8c83-1915b6a7b0.zip/node_modules/d3-quadtree/src/size.js","../../../../.yarn/cache/d3-quadtree-npm-3.0.1-6f0eae8c83-1915b6a7b0.zip/node_modules/d3-quadtree/src/visit.js","../../../../.yarn/cache/d3-quadtree-npm-3.0.1-6f0eae8c83-1915b6a7b0.zip/node_modules/d3-quadtree/src/visitAfter.js","../../../../.yarn/cache/d3-quadtree-npm-3.0.1-6f0eae8c83-1915b6a7b0.zip/node_modules/d3-quadtree/src/x.js","../../../../.yarn/cache/d3-quadtree-npm-3.0.1-6f0eae8c83-1915b6a7b0.zip/node_modules/d3-quadtree/src/y.js","../../../../.yarn/cache/d3-quadtree-npm-3.0.1-6f0eae8c83-1915b6a7b0.zip/node_modules/d3-quadtree/src/quadtree.js","../../../../.yarn/cache/d3-force-npm-3.0.0-462e87e63b-85945f8d44.zip/node_modules/d3-force/src/constant.js","../../../../.yarn/cache/d3-force-npm-3.0.0-462e87e63b-85945f8d44.zip/node_modules/d3-force/src/jiggle.js","../../../../.yarn/cache/d3-force-npm-3.0.0-462e87e63b-85945f8d44.zip/node_modules/d3-force/src/link.js","../../../../.yarn/cache/d3-dispatch-npm-3.0.1-5f44c3166f-2b82f41bf4.zip/node_modules/d3-dispatch/src/dispatch.js","../../../../.yarn/cache/d3-timer-npm-3.0.1-45083f465d-004128602b.zip/node_modules/d3-timer/src/timer.js","../../../../.yarn/cache/d3-force-npm-3.0.0-462e87e63b-85945f8d44.zip/node_modules/d3-force/src/lcg.js","../../../../.yarn/cache/d3-force-npm-3.0.0-462e87e63b-85945f8d44.zip/node_modules/d3-force/src/simulation.js","../../../../.yarn/cache/d3-force-npm-3.0.0-462e87e63b-85945f8d44.zip/node_modules/d3-force/src/manyBody.js","../../../../.yarn/cache/d3-force-npm-3.0.0-462e87e63b-85945f8d44.zip/node_modules/d3-force/src/x.js","../../../../.yarn/cache/d3-force-npm-3.0.0-462e87e63b-85945f8d44.zip/node_modules/d3-force/src/y.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/forceGraph.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/cluster.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/tree.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/tree.js","../../../../.yarn/cache/d3-dsv-npm-3.0.1-5d88fb8a85-a628ac42a2.zip/node_modules/d3-dsv/src/dsv.js","../../../../.yarn/cache/d3-dsv-npm-3.0.1-5d88fb8a85-a628ac42a2.zip/node_modules/d3-dsv/src/autoType.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/fetch.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/fold.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/filter.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/sort.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/pick.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/rename.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/utils/fields.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/sortBy.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/inline.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/custom.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/map.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/utils/d3-cloud/index.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/utils/flow.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/wordCloud.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/join.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/slice.js","../../../../.yarn/cache/pdfast-npm-0.2.0-47afcbf756-497f57283b.zip/node_modules/pdfast/src/helper.js","../../../../.yarn/cache/pdfast-npm-0.2.0-47afcbf756-497f57283b.zip/node_modules/pdfast/src/index.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/kde.js","../../../../.yarn/cache/fmin-npm-0.0.2-8396d465c7-7bbbd9564b.zip/node_modules/fmin/src/bisect.js","../../../../.yarn/cache/fmin-npm-0.0.2-8396d465c7-7bbbd9564b.zip/node_modules/fmin/src/blas1.js","../../../../.yarn/cache/fmin-npm-0.0.2-8396d465c7-7bbbd9564b.zip/node_modules/fmin/src/nelderMead.js","../../../../.yarn/cache/fmin-npm-0.0.2-8396d465c7-7bbbd9564b.zip/node_modules/fmin/src/linesearch.js","../../../../.yarn/cache/fmin-npm-0.0.2-8396d465c7-7bbbd9564b.zip/node_modules/fmin/src/conjugateGradient.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/utils/venn/circleintersection.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/utils/venn/layout.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/utils/venn/diagram.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/venn.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/data/log.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/wordCloud.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/gauge.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/density.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/heatmap.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/mark/liquid.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/palette/category10.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/palette/category20.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/scale/band.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/scale/linear.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/scale/ordinal.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/scale/identity.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/scale/point.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/scale/time.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/scale/log.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/scale/pow.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/scale/threshold.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/scale/quantile.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/scale/quantize.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/scale/sqrt.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/scale/sequential.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/scale/constant.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/theme/create.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/theme/light.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/theme/classic.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/theme/dark.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/theme/classicDark.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/theme/academy.js","../../../../.yarn/cache/d3-format-npm-3.1.0-dfc19924ca-a0fe23d257.zip/node_modules/d3-format/src/formatDecimal.js","../../../../.yarn/cache/d3-format-npm-3.1.0-dfc19924ca-a0fe23d257.zip/node_modules/d3-format/src/exponent.js","../../../../.yarn/cache/d3-format-npm-3.1.0-dfc19924ca-a0fe23d257.zip/node_modules/d3-format/src/formatGroup.js","../../../../.yarn/cache/d3-format-npm-3.1.0-dfc19924ca-a0fe23d257.zip/node_modules/d3-format/src/formatNumerals.js","../../../../.yarn/cache/d3-format-npm-3.1.0-dfc19924ca-a0fe23d257.zip/node_modules/d3-format/src/formatSpecifier.js","../../../../.yarn/cache/d3-format-npm-3.1.0-dfc19924ca-a0fe23d257.zip/node_modules/d3-format/src/formatTrim.js","../../../../.yarn/cache/d3-format-npm-3.1.0-dfc19924ca-a0fe23d257.zip/node_modules/d3-format/src/formatPrefixAuto.js","../../../../.yarn/cache/d3-format-npm-3.1.0-dfc19924ca-a0fe23d257.zip/node_modules/d3-format/src/formatRounded.js","../../../../.yarn/cache/d3-format-npm-3.1.0-dfc19924ca-a0fe23d257.zip/node_modules/d3-format/src/formatTypes.js","../../../../.yarn/cache/d3-format-npm-3.1.0-dfc19924ca-a0fe23d257.zip/node_modules/d3-format/src/identity.js","../../../../.yarn/cache/d3-format-npm-3.1.0-dfc19924ca-a0fe23d257.zip/node_modules/d3-format/src/locale.js","../../../../.yarn/cache/d3-format-npm-3.1.0-dfc19924ca-a0fe23d257.zip/node_modules/d3-format/src/defaultLocale.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/component/utils.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/component/axis.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/component/axisX.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/component/axisY.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/component/axisRadar.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/component/legendCategory.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/component/legendContinuous.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/component/legendContinuousBlock.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/component/legendContinuousSize.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/component/legendContinuousBlockSize.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/component/title.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/utils/scale.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/component/slider.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/component/sliderX.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/component/sliderY.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/component/scrollbar.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/component/scrollbarX.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/component/scrollbarY.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/component/legends.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/animation/scaleInX.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/animation/scaleOutX.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/animation/scaleInY.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/animation/scaleOutY.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/animation/fadeIn.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/animation/fadeOut.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/animation/utils.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/animation/morphing.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/animation/waveIn.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/animation/zoomIn.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/animation/zoomOut.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/animation/pathIn.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/animation/growInX.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/animation/growInY.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/runtime/constant.js","../../../../.yarn/cache/@antv-g-plugin-canvas-path-generator-npm-1.3.21-ad4f4646a1-18533cabee.zip/node_modules/@antv/g-plugin-canvas-path-generator/dist/index.esm.js","../../../../.yarn/cache/@antv-g-plugin-canvas-picker-npm-1.10.23-260c310f0b-2e30b23ef3.zip/node_modules/@antv/g-plugin-canvas-picker/dist/index.esm.js","../../../../.yarn/cache/@antv-g-plugin-canvas-renderer-npm-1.9.23-fc424e8308-52b47272ed.zip/node_modules/@antv/g-plugin-canvas-renderer/dist/index.esm.js","../../../../.yarn/cache/@antv-g-plugin-dom-interaction-npm-1.9.21-17cae66203-fc1fffef9b.zip/node_modules/@antv/g-plugin-dom-interaction/dist/index.esm.js","../../../../.yarn/cache/@antv-g-plugin-html-renderer-npm-1.9.24-520415e683-f1ae6f55a8.zip/node_modules/@antv/g-plugin-html-renderer/dist/index.esm.js","../../../../.yarn/cache/@antv-g-plugin-image-loader-npm-1.3.21-0505f0614e-eb42c24051.zip/node_modules/@antv/g-plugin-image-loader/dist/index.esm.js","../../../../.yarn/cache/@antv-g-canvas-npm-1.11.26-a4a88f5022-8ec75ee8b1.zip/node_modules/@antv/g-canvas/dist/index.esm.js","../../../../.yarn/cache/@antv-g-plugin-dragndrop-npm-1.8.21-33a4756267-6b28f2cdad.zip/node_modules/@antv/g-plugin-dragndrop/dist/index.esm.js","../../../../.yarn/cache/@antv-event-emitter-npm-0.1.3-4621f02e77-c0c6d67ea6.zip/node_modules/@antv/event-emitter/esm/index.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/utils/event.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/component/constant.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/utils/compose.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/utils/isMatrix.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/utils/extend.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/utils/adjustAngle.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/transforms/translate.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/transforms/cartesian.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/transforms/custom.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/transforms/matrix.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/transforms/polar.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/transforms/transpose.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/transforms/scale.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/transforms/reflect.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/transforms/rotate.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/transforms/helix.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/transforms/parallel.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/transforms/shear.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/transforms/fisheye.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/transforms/cartesian3D.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/transforms/translate3D.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/transforms/transpose3D.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/transforms/scale3D.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/coordinate.js","../../../../.yarn/cache/@antv-coord-npm-0.4.7-a69313f9e5-13d9de5dd2.zip/node_modules/@antv/coord/esm/coordinate3D.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/composition/utils.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/composition/spaceLayer.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/composition/spaceFlex.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/composition/view.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/composition/mark.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/utils/container.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/composition/facetRect.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/composition/repeatMatrix.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/composition/facetCircle.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/composition/timingKeyframe.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/composition/geoPath.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/math.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/noop.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/stream.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/cartesian.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/compose.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/rotation.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/circle.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/clip/buffer.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/pointEqual.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/clip/rejoin.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/polygonContains.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/clip/index.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/clip/antimeridian.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/clip/circle.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/clip/line.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/clip/rectangle.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/graticule.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/identity.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/path/area.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/path/bounds.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/path/centroid.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/path/context.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/path/measure.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/path/string.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/path/index.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/transform.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/fit.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/resample.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/index.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/conic.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/cylindricalEqualArea.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/conicEqualArea.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/albers.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/albersUsa.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/azimuthal.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/azimuthalEqualArea.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/azimuthalEquidistant.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/mercator.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/conicConformal.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/equirectangular.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/conicEquidistant.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/equalEarth.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/gnomonic.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/identity.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/naturalEarth1.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/orthographic.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/stereographic.js","../../../../.yarn/cache/d3-geo-npm-3.1.0-0fe5a4b730-d214c2951c.zip/node_modules/d3-geo/src/projection/transverseMercator.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/composition/geoView.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/event.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/lib/builtinlib.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/runtime/library.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/runtime/coordinate.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/colors.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/categorical/category10.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/categorical/Accent.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/categorical/Dark2.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/categorical/Paired.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/categorical/Pastel1.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/categorical/Pastel2.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/categorical/Set1.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/categorical/Set2.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/categorical/Set3.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/categorical/Tableau10.js","../../../../.yarn/cache/d3-color-npm-3.1.0-fc73fe3b15-536ba05bfd.zip/node_modules/d3-color/src/define.js","../../../../.yarn/cache/d3-color-npm-3.1.0-fc73fe3b15-536ba05bfd.zip/node_modules/d3-color/src/color.js","../../../../.yarn/cache/d3-color-npm-3.1.0-fc73fe3b15-536ba05bfd.zip/node_modules/d3-color/src/math.js","../../../../.yarn/cache/d3-color-npm-3.1.0-fc73fe3b15-536ba05bfd.zip/node_modules/d3-color/src/cubehelix.js","../../../../.yarn/cache/d3-interpolate-npm-3.0.1-77ddca7977-988d66497e.zip/node_modules/d3-interpolate/src/basis.js","../../../../.yarn/cache/d3-interpolate-npm-3.0.1-77ddca7977-988d66497e.zip/node_modules/d3-interpolate/src/constant.js","../../../../.yarn/cache/d3-interpolate-npm-3.0.1-77ddca7977-988d66497e.zip/node_modules/d3-interpolate/src/color.js","../../../../.yarn/cache/d3-interpolate-npm-3.0.1-77ddca7977-988d66497e.zip/node_modules/d3-interpolate/src/rgb.js","../../../../.yarn/cache/d3-interpolate-npm-3.0.1-77ddca7977-988d66497e.zip/node_modules/d3-interpolate/src/cubehelix.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/ramp.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/diverging/BrBG.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/diverging/PRGn.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/diverging/PiYG.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/diverging/PuOr.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/diverging/RdBu.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/diverging/RdGy.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/diverging/RdYlBu.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/diverging/RdYlGn.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/diverging/Spectral.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-multi/BuGn.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-multi/BuPu.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-multi/GnBu.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-multi/OrRd.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-multi/PuBuGn.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-multi/PuBu.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-multi/PuRd.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-multi/RdPu.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-multi/YlGnBu.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-multi/YlGn.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-multi/YlOrBr.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-multi/YlOrRd.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-single/Blues.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-single/Greens.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-single/Greys.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-single/Purples.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-single/Reds.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-single/Oranges.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-multi/cividis.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-multi/cubehelix.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-multi/rainbow.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-multi/sinebow.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-multi/turbo.js","../../../../.yarn/cache/d3-scale-chromatic-npm-3.0.0-ca3b48a3cb-e4d23a7d2b.zip/node_modules/d3-scale-chromatic/src/sequential-multi/viridis.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/runtime/scale.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/runtime/types/scale.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/runtime/component.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/runtime/layout.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/runtime/transform.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/runtime/mark.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/runtime/plot.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/runtime/render.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/utils/style.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/utils.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/elementHighlight.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/elementHighlightByX.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/elementHighlightByColor.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/elementSelect.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/elementSelectByX.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/elementSelectByColor.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/chartIndex.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/fisheye.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/tooltip.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/legendFilter.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/legendHighlight.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/brushHighlight.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/brushXHighlight.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/brushYHighlight.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/brushAxisHighlight.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/brushFilter.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/brushXFilter.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/brushYFilter.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/sliderFilter.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/scrollbarFilter.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/poptip.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/interaction/treemapDrillDown.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/utils/bounds.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/label-transform/overlapHide.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/label-transform/overlapDodgeY.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/utils/color.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/label-transform/contrastReverse.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/label-transform/overflowHide.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/lib/core.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/lib/geo.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/lib/graph.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/lib/plot.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/lib/std.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/api/extend.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/api/library.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/utils/size.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/api/node.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/api/utils.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/api/define.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/api/props.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/api/composition.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/api/mark.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/api/runtime.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/exports.js","../../../../.yarn/cache/@antv-g2-npm-5.1.15-d846143677-1a6c9a1a0d.zip/node_modules/@antv/g2/esm/index.js","../../../../.yarn/__virtual__/@ant-design-charts-util-virtual-4c50362436/0/cache/@ant-design-charts-util-npm-0.0.1-alpha.5-0ef3c44822-b4331cc94c.zip/node_modules/@ant-design/charts-util/es/react/render.js","../../../../.yarn/__virtual__/@ant-design-charts-util-virtual-4c50362436/0/cache/@ant-design-charts-util-npm-0.0.1-alpha.5-0ef3c44822-b4331cc94c.zip/node_modules/@ant-design/charts-util/es/rc/create-node.js","../../../../.yarn/__virtual__/@ant-design-charts-util-virtual-4c50362436/0/cache/@ant-design-charts-util-npm-0.0.1-alpha.5-0ef3c44822-b4331cc94c.zip/node_modules/@ant-design/charts-util/es/rc/chart-loading.js","../../../../.yarn/__virtual__/@ant-design-charts-util-virtual-4c50362436/0/cache/@ant-design-charts-util-npm-0.0.1-alpha.5-0ef3c44822-b4331cc94c.zip/node_modules/@ant-design/charts-util/es/rc/error-boundary.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/util/is-valid-element.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/hooks/useChart.js","../../../../.yarn/cache/@antv-g2-extension-plot-npm-0.1.1-89404f6fdc-27947d9d29.zip/node_modules/@antv/g2-extension-plot/esm/utils/hierarchy/partition.js","../../../../.yarn/cache/@antv-g2-extension-plot-npm-0.1.1-89404f6fdc-27947d9d29.zip/node_modules/@antv/g2-extension-plot/esm/mark/sunburst.js","../../../../.yarn/cache/@antv-g2-extension-plot-npm-0.1.1-89404f6fdc-27947d9d29.zip/node_modules/@antv/g2-extension-plot/esm/interaction/drillDown.js","../../../../.yarn/cache/@antv-g2-extension-plot-npm-0.1.1-89404f6fdc-27947d9d29.zip/node_modules/@antv/g2-extension-plot/esm/lib.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/base/chart.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/utils/transform.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/utils/delete-excess-keys.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/utils/filter-transformed.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/utils/merge-with-array-coverage.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/constants/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/annotation/shapes/Text.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/annotation/shapes/Polygon.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/annotation/core.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/annotation/conversion-tag.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/bidirectional-bar/constants.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/annotation/bidirectional-bar-axis-text.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/annotation/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/base/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/base/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/adaptor/shape-stack.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/adaptor/mark.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/adaptor/coordinate-layout.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/area/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/area/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/bar/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/bar/shape.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/bar/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/column/shape.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/column/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/dual-axes/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/dual-axes/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/funnel/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/funnel/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/line/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/line/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/pie/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/pie/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/scatter/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/scatter/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/radar/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/radar/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/stock/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/stock/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/tiny-line/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/tiny-line/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/tiny-area/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/tiny-area/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/tiny-column/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/tiny-column/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/tiny-progress/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/tiny-progress/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/tiny-ring/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/tiny-ring/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/rose/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/rose/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/waterfall/constants.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/waterfall/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/waterfall/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/histogram/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/histogram/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/heatmap/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/heatmap/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/box/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/box/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/sankey/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/sankey/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/bullet/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/bullet/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/gauge/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/gauge/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/liquid/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/liquid/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/wordCloud/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/wordCloud/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/treemap/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/treemap/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/radial-bar/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/radial-bar/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/circlePacking/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/circlePacking/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/violin/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/violin/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/bidirectional-bar/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/bidirectional-bar/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/venn/type.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/venn/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/venn/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/sunburst/adaptor.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/plots/sunburst/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/core/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/components/base/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/components/area/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/components/bar/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/components/column/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/components/line/index.js","../../../../.yarn/__virtual__/@ant-design-plots-virtual-bcf936d1cb/0/cache/@ant-design-plots-npm-2.1.12-3ccef785ee-1c16734b79.zip/node_modules/@ant-design/plots/es/components/pie/index.js"],"sourcesContent":["/**\n * Default coordinate transformation for all charts.\n */\nexport const Cartesian = () => [['cartesian']];\nCartesian.props = {};\n//# sourceMappingURL=cartesian.js.map","export function toRadian(degree) {\n return (degree * Math.PI) / 180;\n}\nexport function toDegree(radian) {\n return (radian * 180) / Math.PI;\n}\n// convert the angle to the range of 0 to 4*Math.PI\nexport function convertAngles(startAngle, endAngle) {\n startAngle = startAngle % (2 * Math.PI);\n endAngle = endAngle % (2 * Math.PI);\n if (startAngle < 0) {\n startAngle = 2 * Math.PI + startAngle;\n }\n if (endAngle < 0) {\n endAngle = 2 * Math.PI + endAngle;\n }\n if (startAngle >= endAngle) {\n endAngle = endAngle + 2 * Math.PI;\n }\n return {\n startAngle,\n endAngle,\n };\n}\n//# sourceMappingURL=angle.js.map","import { convertAngles } from '../utils/angle';\nexport const getPolarOptions = (options = {}) => {\n const defaultOptions = {\n startAngle: -Math.PI / 2,\n endAngle: (Math.PI * 3) / 2,\n innerRadius: 0,\n outerRadius: 1,\n };\n const polarOption = Object.assign(Object.assign({}, defaultOptions), options);\n return Object.assign(Object.assign({}, polarOption), convertAngles(polarOption.startAngle, polarOption.endAngle));\n};\n/**\n * Polar transformation for circular charts using center of canvas as origin.\n * @todo Adjust size of canvas by startAngle and endAngle to make chart as big as possible.\n */\nexport const Polar = (options) => {\n const { startAngle, endAngle, innerRadius, outerRadius } = getPolarOptions(options);\n return [\n ['translate', 0, 0.5],\n ['reflect.y'],\n ['translate', 0, -0.5],\n ['polar', startAngle, endAngle, innerRadius, outerRadius],\n ];\n};\nPolar.props = {};\n//# sourceMappingURL=polar.js.map","/**\n * Transpose transformation for transposing chart according to center of canvas.\n */\nexport const Transpose = () => [\n ['transpose'],\n ['translate', 0.5, 0.5],\n ['reflect.x'],\n ['translate', -0.5, -0.5],\n];\nTranspose.props = { transform: true };\n//# sourceMappingURL=transpose.js.map","import { Polar } from './polar';\nimport { Transpose } from './transpose';\nexport const getThetaOptions = (options = {}) => {\n const defaultOptions = {\n startAngle: -Math.PI / 2,\n endAngle: (Math.PI * 3) / 2,\n innerRadius: 0,\n outerRadius: 1,\n };\n return Object.assign(Object.assign({}, defaultOptions), options);\n};\n/**\n * Theta = Transpose + Polar.\n */\nexport const Theta = (options) => {\n const { startAngle, endAngle, innerRadius, outerRadius } = getThetaOptions(options);\n return [\n ...Transpose(),\n ...Polar({ startAngle, endAngle, innerRadius, outerRadius }),\n ];\n};\nTheta.props = {};\n//# sourceMappingURL=theta.js.map","import { Polar } from './polar';\nexport const getRadialOptions = (options = {}) => {\n const defaultOptions = {\n startAngle: -Math.PI / 2,\n endAngle: (Math.PI * 3) / 2,\n innerRadius: 0,\n outerRadius: 1,\n };\n return Object.assign(Object.assign({}, defaultOptions), options);\n};\n/**\n * Radial\n */\nexport const Radial = (options) => {\n const { startAngle, endAngle, innerRadius, outerRadius } = getRadialOptions(options);\n return [\n ['transpose'],\n ['translate', 0.5, 0.5],\n ['reflect'],\n ['translate', -0.5, -0.5],\n ...Polar({ startAngle, endAngle, innerRadius, outerRadius }),\n ];\n};\nRadial.props = {};\n//# sourceMappingURL=radial.js.map","/**\n * Parallel coordinate transformations for parallel coordinate.\n */\nexport const Parallel = () => [['parallel', 0, 1, 0, 1]];\nParallel.props = {};\n//# sourceMappingURL=parallel.js.map","/**\n * Fisheye\n */\nexport const Fisheye = ({ focusX = 0, focusY = 0, distortionX = 2, distortionY = 2, visual = false, }) => [['fisheye', focusX, focusY, distortionX, distortionY, visual]];\nFisheye.props = { transform: true };\n//# sourceMappingURL=fisheye.js.map","import { Polar } from './polar';\nimport { Parallel } from './parallel';\n/**\n * Radar = Parallel + Polar.\n */\nexport const Radar = (options) => {\n const { startAngle = -Math.PI / 2, endAngle = (Math.PI * 3) / 2, innerRadius = 0, outerRadius = 1, } = options;\n return [\n ...Parallel(),\n ...Polar({ startAngle, endAngle, innerRadius, outerRadius }),\n ];\n};\nRadar.props = {};\n//# sourceMappingURL=radar.js.map","/**\n * Extract a column of data filled with the specified constant.\n */\nexport const Constant = ({ value }) => {\n return (data) => data.map(() => value);\n};\nConstant.props = {};\n//# sourceMappingURL=constant.js.map","/**\n * Extract a column of data with specified map function from data.\n * Each datum in the array is not visual data by default.\n * Specifying identity scale for related channel explicitly will treat them as visual data.\n */\nexport const Transform = ({ value }) => {\n return (data) => data.map(value);\n};\nTransform.props = {};\n//# sourceMappingURL=transform.js.map","/**\n * Extract a column of data with specified field.\n */\nexport const Field = ({ value }) => {\n return (data) => data.map((d) => d[value]);\n};\nField.props = {};\n//# sourceMappingURL=field.js.map","/**\n * Extract a column of data specified in encoding.\n */\nexport const Column = ({ value }) => {\n return () => value;\n};\nColumn.props = {};\n//# sourceMappingURL=column.js.map","var isArrayLike = function (value) {\n /**\n * isArrayLike([1, 2, 3]) => true\n * isArrayLike(document.body.children) => true\n * isArrayLike('abc') => true\n * isArrayLike(Function) => false\n */\n return value !== null && typeof value !== 'function' && isFinite(value.length);\n};\nexport default isArrayLike;\n//# sourceMappingURL=is-array-like.js.map","import isArrayLike from './is-array-like';\nvar filter = function (arr, func) {\n if (!isArrayLike(arr)) {\n return arr;\n }\n var result = [];\n for (var index = 0; index < arr.length; index++) {\n var value = arr[index];\n if (func(value, index)) {\n result.push(value);\n }\n }\n return result;\n};\nexport default filter;\n//# sourceMappingURL=filter.js.map","/**\n * @see https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_isfunction\n */\nexport default (function (value) {\n return typeof value === 'function';\n});\n//# sourceMappingURL=is-function.js.map","// isFinite,\nvar isNil = function (value) {\n /**\n * isNil(null) => true\n * isNil() => true\n */\n return value === null || value === undefined;\n};\nexport default isNil;\n//# sourceMappingURL=is-nil.js.map","var toString = {}.toString;\nvar isType = function (value, type) { return toString.call(value) === '[object ' + type + ']'; };\nexport default isType;\n//# sourceMappingURL=is-type.js.map","import isType from './is-type';\nexport default (function (value) {\n return Array.isArray ? Array.isArray(value) : isType(value, 'Array');\n});\n//# sourceMappingURL=is-array.js.map","export default (function (value) {\n /**\n * isObject({}) => true\n * isObject([1, 2, 3]) => true\n * isObject(Function) => true\n * isObject(null) => false\n */\n var type = typeof value;\n return (value !== null && type === 'object') || type === 'function';\n});\n//# sourceMappingURL=is-object.js.map","import isArray from './is-array';\nimport isObject from './is-object';\nfunction each(elements, func) {\n if (!elements) {\n return;\n }\n var rst;\n if (isArray(elements)) {\n for (var i = 0, len = elements.length; i < len; i++) {\n rst = func(elements[i], i);\n if (rst === false) {\n break;\n }\n }\n }\n else if (isObject(elements)) {\n for (var k in elements) {\n if (elements.hasOwnProperty(k)) {\n rst = func(elements[k], k);\n if (rst === false) {\n break;\n }\n }\n }\n }\n}\nexport default each;\n//# sourceMappingURL=each.js.map","import each from './each';\nimport isFunction from './is-function';\nvar keys = Object.keys\n ? function (obj) { return Object.keys(obj); }\n : function (obj) {\n var result = [];\n each(obj, function (value, key) {\n if (!(isFunction(obj) && key === 'prototype')) {\n result.push(key);\n }\n });\n return result;\n };\nexport default keys;\n//# sourceMappingURL=keys.js.map","import isNil from './is-nil';\nimport keys from './keys';\nfunction isMatch(obj, attrs) {\n var _keys = keys(attrs);\n var length = _keys.length;\n if (isNil(obj))\n return !length;\n for (var i = 0; i < length; i += 1) {\n var key = _keys[i];\n if (attrs[key] !== obj[key] || !(key in obj)) {\n return false;\n }\n }\n return true;\n}\nexport default isMatch;\n//# sourceMappingURL=is-match.js.map","var isObjectLike = function (value) {\n /**\n * isObjectLike({}) => true\n * isObjectLike([1, 2, 3]) => true\n * isObjectLike(Function) => false\n * isObjectLike(null) => false\n */\n return typeof value === 'object' && value !== null;\n};\nexport default isObjectLike;\n//# sourceMappingURL=is-object-like.js.map","import isObjectLike from './is-object-like';\nimport isType from './is-type';\nvar isPlainObject = function (value) {\n /**\n * isObjectLike(new Foo) => false\n * isObjectLike([1, 2, 3]) => false\n * isObjectLike({ x: 0, y: 0 }) => true\n * isObjectLike(Object.create(null)) => true\n */\n if (!isObjectLike(value) || !isType(value, 'Object')) {\n return false;\n }\n if (Object.getPrototypeOf(value) === null) {\n return true;\n }\n var proto = value;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(value) === proto;\n};\nexport default isPlainObject;\n//# sourceMappingURL=is-plain-object.js.map","import isFunction from './is-function';\nimport isMatch from './is-match';\nimport isArray from './is-array';\nimport isPlainObject from './is-plain-object';\nfunction find(arr, predicate) {\n if (!isArray(arr))\n return null;\n var _predicate;\n if (isFunction(predicate)) {\n _predicate = predicate;\n }\n if (isPlainObject(predicate)) {\n _predicate = function (a) { return isMatch(a, predicate); };\n }\n if (_predicate) {\n for (var i = 0; i < arr.length; i += 1) {\n if (_predicate(arr[i])) {\n return arr[i];\n }\n }\n }\n return null;\n}\nexport default find;\n//# sourceMappingURL=find.js.map","import isArray from './is-array';\n/**\n * @param {Array} arr The array to iterate over.\n * @return {*} Returns the maximum value.\n * @example\n *\n * max([1, 2]);\n * // => 2\n *\n * max([]);\n * // => undefined\n *\n * const data = new Array(1250010).fill(1).map((d,idx) => idx);\n *\n * max(data);\n * // => 1250010\n * // Math.max(...data) will encounter \"Maximum call stack size exceeded\" error\n */\nexport default (function (arr) {\n if (!isArray(arr)) {\n return undefined;\n }\n return arr.reduce(function (prev, curr) {\n return Math.max(prev, curr);\n }, arr[0]);\n});\n//# sourceMappingURL=max.js.map","import isArray from './is-array';\n/**\n * @param {Array} arr The array to iterate over.\n * @return {*} Returns the minimum value.\n * @example\n *\n * min([1, 2]);\n * // => 1\n *\n * min([]);\n * // => undefined\n *\n * const data = new Array(1250010).fill(1).map((d,idx) => idx);\n *\n * min(data);\n * // => 1250010\n * // Math.min(...data) will encounter \"Maximum call stack size exceeded\" error\n */\nexport default (function (arr) {\n if (!isArray(arr)) {\n return undefined;\n }\n return arr.reduce(function (prev, curr) {\n return Math.min(prev, curr);\n }, arr[0]);\n});\n//# sourceMappingURL=min.js.map","import each from './each';\nimport isArray from './is-array';\nimport isPlainObject from './is-plain-object';\nvar reduce = function (arr, fn, init) {\n if (!isArray(arr) && !isPlainObject(arr)) {\n return arr;\n }\n var result = init;\n each(arr, function (data, i) {\n result = fn(result, data, i);\n });\n return result;\n};\nexport default reduce;\n//# sourceMappingURL=reduce.js.map","import isType from './is-type';\nexport default (function (str) {\n return isType(str, 'String');\n});\n//# sourceMappingURL=is-string.js.map","import isArrayLike from './is-array-like';\nexport default function last(o) {\n if (isArrayLike(o)) {\n var arr = o;\n return arr[arr.length - 1];\n }\n return undefined;\n}\n//# sourceMappingURL=last.js.map","var clamp = function (a, min, max) {\n if (a < min) {\n return min;\n }\n else if (a > max) {\n return max;\n }\n return a;\n};\nexport default clamp;\n//# sourceMappingURL=clamp.js.map","/**\n * 判断是否数字\n * @return {Boolean} 是否数字\n */\nimport isType from './is-type';\nvar isNumber = function (value) {\n return isType(value, 'Number');\n};\nexport default isNumber;\n//# sourceMappingURL=is-number.js.map","var PRECISION = 0.00001; // numbers less than this is considered as 0\nexport default function isNumberEqual(a, b, precision) {\n if (precision === void 0) { precision = PRECISION; }\n return Math.abs(a - b) < precision;\n}\n//# sourceMappingURL=is-number-equal.js.map","import isArray from './is-array';\nimport isFunction from './is-function';\n/**\n * @param {Array} arr The array to iterate over.\n * @param {Function} [fn] The iteratee invoked per element.\n * @return {*} Returns the maximum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * maxBy(objects, function(o) { return o.n; });\n * // => { 'n': 2 }\n *\n * maxBy(objects, 'n');\n * // => { 'n': 2 }\n */\nexport default (function (arr, fn) {\n if (!isArray(arr)) {\n return undefined;\n }\n var maxItem;\n var max = -Infinity;\n for (var i = 0; i < arr.length; i++) {\n var item = arr[i];\n var v = isFunction(fn) ? fn(item) : item[fn];\n if (v > max) {\n maxItem = item;\n max = v;\n }\n }\n return maxItem;\n});\n//# sourceMappingURL=max-by.js.map","import isArray from './is-array';\nimport isFunction from './is-function';\n/**\n * @param {Array} arr The array to iterate over.\n * @param {Function} [fn] The iteratee invoked per element.\n * @return {*} Returns the minimum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * minBy(objects, function(o) { return o.n; });\n * // => { 'n': 1 }\n *\n * minBy(objects, 'n');\n * // => { 'n': 1 }\n */\nexport default (function (arr, fn) {\n if (!isArray(arr)) {\n return undefined;\n }\n var minItem;\n var min = Infinity;\n for (var i = 0; i < arr.length; i++) {\n var item = arr[i];\n var v = isFunction(fn) ? fn(item) : item[fn];\n if (v < min) {\n minItem = item;\n min = v;\n }\n }\n return minItem;\n});\n//# sourceMappingURL=min-by.js.map","var mod = function (n, m) {\n return ((n % m) + m) % m;\n};\nexport default mod;\n//# sourceMappingURL=mod.js.map","import isNil from './is-nil';\nexport default (function (value) {\n if (isNil(value))\n return '';\n return value.toString();\n});\n//# sourceMappingURL=to-string.js.map","import toString from './to-string';\nvar lowerFirst = function (value) {\n var str = toString(value);\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\nexport default lowerFirst;\n//# sourceMappingURL=lower-first.js.map","function substitute(str, o) {\n if (!str || !o) {\n return str;\n }\n return str.replace(/\\\\?\\{([^{}]+)\\}/g, function (match, name) {\n if (match.charAt(0) === '\\\\') {\n return match.slice(1);\n }\n return o[name] === undefined ? '' : o[name];\n });\n}\nexport default substitute;\n//# sourceMappingURL=substitute.js.map","import toString from './to-string';\nvar upperFirst = function (value) {\n var str = toString(value);\n return str.charAt(0).toUpperCase() + str.substring(1);\n};\nexport default upperFirst;\n//# sourceMappingURL=upper-first.js.map","/**\n * 是否是布尔类型\n *\n * @param {Object} value 测试的值\n * @return {Boolean}\n */\nimport isType from './is-type';\nvar isBoolean = function (value) {\n return isType(value, 'Boolean');\n};\nexport default isBoolean;\n//# sourceMappingURL=is-boolean.js.map","var isUndefined = function (value) {\n return value === undefined;\n};\nexport default isUndefined;\n//# sourceMappingURL=is-undefined.js.map","// FIXME: Mutable param should be forbidden in static lang.\nfunction _mix(dist, obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && key !== 'constructor' && obj[key] !== undefined) {\n dist[key] = obj[key];\n }\n }\n}\nexport default function mix(dist, src1, src2, src3) {\n if (src1)\n _mix(dist, src1);\n if (src2)\n _mix(dist, src2);\n if (src3)\n _mix(dist, src3);\n return dist;\n}\n//# sourceMappingURL=mix.js.map","import isArray from './is-array';\nvar clone = function (obj) {\n if (typeof obj !== 'object' || obj === null) {\n return obj;\n }\n var rst;\n if (isArray(obj)) {\n rst = [];\n for (var i = 0, l = obj.length; i < l; i++) {\n if (typeof obj[i] === 'object' && obj[i] != null) {\n rst[i] = clone(obj[i]);\n }\n else {\n rst[i] = obj[i];\n }\n }\n }\n else {\n rst = {};\n for (var k in obj) {\n if (typeof obj[k] === 'object' && obj[k] != null) {\n rst[k] = clone(obj[k]);\n }\n else {\n rst[k] = obj[k];\n }\n }\n }\n return rst;\n};\nexport default clone;\n//# sourceMappingURL=clone.js.map","function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this, args = arguments;\n var later = function () {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n}\nexport default debounce;\n//# sourceMappingURL=debounce.js.map","import isFunction from './is-function';\nfunction flru(max) {\n var num, curr, prev;\n var limit = max || 1;\n function keep(key, value) {\n if (++num > limit) {\n prev = curr;\n reset(1);\n ++num;\n }\n curr[key] = value;\n }\n function reset(isPartial) {\n num = 0;\n curr = Object.create(null);\n isPartial || (prev = Object.create(null));\n }\n reset();\n return {\n clear: reset,\n has: function (key) {\n return curr[key] !== void 0 || prev[key] !== void 0;\n },\n get: function (key) {\n var val = curr[key];\n if (val !== void 0)\n return val;\n if ((val = prev[key]) !== void 0) {\n keep(key, val);\n return val;\n }\n },\n set: function (key, value) {\n if (curr[key] !== void 0) {\n curr[key] = value;\n }\n else {\n keep(key, value);\n }\n },\n };\n}\n/**\n * _.memoize(calColor);\n * _.memoize(calColor, (...args) => args[0]);\n * @param f\n * @param resolver\n * @param maxSize lru maxSize\n */\nexport default (function (f, resolver, maxSize) {\n if (maxSize === void 0) { maxSize = 128; }\n if (!isFunction(f)) {\n throw new TypeError('Expected a function');\n }\n var memoized = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n // 使用方法构造 key,如果不存在 resolver,则直接取第一个参数作为 key\n var key = resolver ? resolver.apply(this, args) : args[0];\n var cache = memoized.cache;\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = f.apply(this, args);\n // 缓存起来\n cache.set(key, result);\n return result;\n };\n memoized.cache = flru(maxSize);\n return memoized;\n});\n//# sourceMappingURL=memoize.js.map","import isArray from './is-array';\nimport isPlainObject from './is-plain-object';\nvar MAX_MIX_LEVEL = 5;\nfunction hasOwn(object, property) {\n if (Object.hasOwn) {\n return Object.hasOwn(object, property);\n }\n if (object == null) {\n throw new TypeError('Cannot convert undefined or null to object');\n }\n return Object.prototype.hasOwnProperty.call(Object(object), property);\n}\nfunction _deepMix(dist, src, level, maxLevel) {\n level = level || 0;\n maxLevel = maxLevel || MAX_MIX_LEVEL;\n for (var key in src) {\n if (hasOwn(src, key)) {\n var value = src[key];\n if (value !== null && isPlainObject(value)) {\n if (!isPlainObject(dist[key])) {\n dist[key] = {};\n }\n if (level < maxLevel) {\n _deepMix(dist[key], value, level + 1, maxLevel);\n }\n else {\n dist[key] = src[key];\n }\n }\n else if (isArray(value)) {\n dist[key] = [];\n dist[key] = dist[key].concat(value);\n }\n else if (value !== undefined) {\n dist[key] = value;\n }\n }\n }\n}\n// todo 重写\nvar deepMix = function (rst) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n for (var i = 0; i < args.length; i += 1) {\n _deepMix(rst, args[i]);\n }\n return rst;\n};\nexport default deepMix;\n//# sourceMappingURL=deep-mix.js.map","import isObjectLike from './is-object-like';\nimport isArrayLike from './is-array-like';\nimport isString from './is-string';\nvar isEqual = function (value, other) {\n if (value === other) {\n return true;\n }\n if (!value || !other) {\n return false;\n }\n if (isString(value) || isString(other)) {\n return false;\n }\n if (isArrayLike(value) || isArrayLike(other)) {\n if (value.length !== other.length) {\n return false;\n }\n var rst = true;\n for (var i = 0; i < value.length; i++) {\n rst = isEqual(value[i], other[i]);\n if (!rst) {\n break;\n }\n }\n return rst;\n }\n if (isObjectLike(value) || isObjectLike(other)) {\n var valueKeys = Object.keys(value);\n var otherKeys = Object.keys(other);\n if (valueKeys.length !== otherKeys.length) {\n return false;\n }\n var rst = true;\n for (var i = 0; i < valueKeys.length; i++) {\n rst = isEqual(value[valueKeys[i]], other[valueKeys[i]]);\n if (!rst) {\n break;\n }\n }\n return rst;\n }\n return false;\n};\nexport default isEqual;\n//# sourceMappingURL=is-equal.js.map","import isString from './is-string';\n/**\n * https://github.com/developit/dlv/blob/master/index.js\n * @param obj\n * @param key\n * @param defaultValue\n */\nexport default (function (obj, key, defaultValue) {\n var p = 0;\n var keyArr = isString(key) ? key.split('.') : key;\n while (obj && p < keyArr.length) {\n obj = obj[keyArr[p++]];\n }\n return obj === undefined || p < keyArr.length ? defaultValue : obj;\n});\n//# sourceMappingURL=get.js.map","import isObject from './is-object';\nimport isString from './is-string';\nimport isNumber from './is-number';\n/**\n * https://github.com/developit/dlv/blob/master/index.js\n * @param obj\n * @param path\n * @param value\n */\nexport default (function (obj, path, value) {\n var o = obj;\n var keyArr = isString(path) ? path.split('.') : path;\n keyArr.forEach(function (key, idx) {\n // 不是最后一个\n if (idx < keyArr.length - 1) {\n if (!isObject(o[key])) {\n o[key] = isNumber(keyArr[idx + 1]) ? [] : {};\n }\n o = o[key];\n }\n else {\n o[key] = value;\n }\n });\n return obj;\n});\n//# sourceMappingURL=set.js.map","import each from './each';\nimport isPlainObject from './is-plain-object';\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nexport default (function (object, keys) {\n if (object === null || !isPlainObject(object)) {\n return {};\n }\n var result = {};\n each(keys, function (key) {\n if (hasOwnProperty.call(object, key)) {\n result[key] = object[key];\n }\n });\n return result;\n});\n//# sourceMappingURL=pick.js.map","import reduce from './reduce';\nexport default (function (obj, keys) {\n return reduce(obj, function (r, curr, key) {\n if (!keys.includes(key)) {\n r[key] = curr;\n }\n return r;\n }, {});\n});\n//# sourceMappingURL=omit.js.map","export default (function (func, wait, options) {\n var timeout, context, args, result;\n var previous = 0;\n if (!options)\n options = {};\n var later = function () {\n previous = options.leading === false ? 0 : Date.now();\n timeout = null;\n result = func.apply(context, args);\n if (!timeout)\n context = args = null;\n };\n var throttled = function () {\n var now = Date.now();\n if (!previous && options.leading === false)\n previous = now;\n var remaining = wait - (now - previous);\n context = this;\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n previous = now;\n result = func.apply(context, args);\n if (!timeout)\n context = args = null;\n }\n else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n throttled.cancel = function () {\n clearTimeout(timeout);\n previous = 0;\n timeout = context = args = null;\n };\n return throttled;\n});\n//# sourceMappingURL=throttle.js.map","export default (function () { });\n//# sourceMappingURL=noop.js.map","import isNil from './is-nil';\nimport isArraylike from './is-array-like';\nexport default function size(o) {\n if (isNil(o)) {\n return 0;\n }\n if (isArraylike(o)) {\n return o.length;\n }\n return Object.keys(o).length;\n}\n//# sourceMappingURL=size.js.map","/**\n * Common utilities\n * @module glMatrix\n */\n// Configuration Constants\nexport var EPSILON = 0.000001;\nexport var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexport var RANDOM = Math.random;\n/**\n * Sets the type of array used when creating new vectors and matrices\n *\n * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array\n */\n\nexport function setMatrixArrayType(type) {\n ARRAY_TYPE = type;\n}\nvar degree = Math.PI / 180;\n/**\n * Convert Degree To Radian\n *\n * @param {Number} a Angle in Degrees\n */\n\nexport function toRadian(a) {\n return a * degree;\n}\n/**\n * Tests whether or not the arguments have approximately the same value, within an absolute\n * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less\n * than or equal to 1.0, and a relative tolerance is used for larger values)\n *\n * @param {Number} a The first number to test.\n * @param {Number} b The second number to test.\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\n */\n\nexport function equals(a, b) {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n}\nif (!Math.hypot) Math.hypot = function () {\n var y = 0,\n i = arguments.length;\n\n while (i--) {\n y += arguments[i] * arguments[i];\n }\n\n return Math.sqrt(y);\n};","import * as glMatrix from \"./common.js\";\n/**\n * 3x3 Matrix\n * @module mat3\n */\n\n/**\n * Creates a new identity mat3\n *\n * @returns {mat3} a new 3x3 matrix\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(9);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n }\n\n out[0] = 1;\n out[4] = 1;\n out[8] = 1;\n return out;\n}\n/**\n * Copies the upper-left 3x3 values into the given mat3.\n *\n * @param {mat3} out the receiving 3x3 matrix\n * @param {ReadonlyMat4} a the source 4x4 matrix\n * @returns {mat3} out\n */\n\nexport function fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n}\n/**\n * Creates a new mat3 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat3} a matrix to clone\n * @returns {mat3} a new 3x3 matrix\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\n * Copy the values from one mat3 to another\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\n * Create a new mat3 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\n * @returns {mat3} A new mat3\n */\n\nexport function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\n * Set the components of a mat3 to the given values\n *\n * @param {mat3} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\n * @returns {mat3} out\n */\n\nexport function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\n * Set a mat3 to the identity matrix\n *\n * @param {mat3} out the receiving matrix\n * @returns {mat3} out\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\n * Transpose the values of a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n\n return out;\n}\n/**\n * Inverts a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\nexport function invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b01 = a22 * a11 - a12 * a21;\n var b11 = -a22 * a10 + a12 * a20;\n var b21 = a21 * a10 - a11 * a20; // Calculate the determinant\n\n var det = a00 * b01 + a01 * b11 + a02 * b21;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n}\n/**\n * Calculates the adjugate of a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\nexport function adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n}\n/**\n * Calculates the determinant of a mat3\n *\n * @param {ReadonlyMat3} a the source matrix\n * @returns {Number} determinant of a\n */\n\nexport function determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n}\n/**\n * Multiplies two mat3's\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\n\nexport function multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b00 = b[0],\n b01 = b[1],\n b02 = b[2];\n var b10 = b[3],\n b11 = b[4],\n b12 = b[5];\n var b20 = b[6],\n b21 = b[7],\n b22 = b[8];\n out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n return out;\n}\n/**\n * Translate a mat3 by the given vector\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to translate\n * @param {ReadonlyVec2} v vector to translate by\n * @returns {mat3} out\n */\n\nexport function translate(out, a, v) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n x = v[0],\n y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n}\n/**\n * Rotates a mat3 by the given angle\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat3} out\n */\n\nexport function rotate(out, a, rad) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n}\n/**\n * Scales the mat3 by the dimensions in the given vec2\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to rotate\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\n * @returns {mat3} out\n **/\n\nexport function scale(out, a, v) {\n var x = v[0],\n y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyVec2} v Translation vector\n * @returns {mat3} out\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n}\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat3} out\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyVec2} v Scaling vector\n * @returns {mat3} out\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\n * Copies the values from a mat2d into a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to copy\n * @returns {mat3} out\n **/\n\nexport function fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n}\n/**\n * Calculates a 3x3 matrix from the given quaternion\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyQuat} q Quaternion to create matrix from\n *\n * @returns {mat3} out\n */\n\nexport function fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n}\n/**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n *\n * @returns {mat3} out\n */\n\nexport function normalFromMat4(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n}\n/**\n * Generates a 2D projection matrix with the given bounds\n *\n * @param {mat3} out mat3 frustum matrix will be written into\n * @param {number} width Width of your gl context\n * @param {number} height Height of gl context\n * @returns {mat3} out\n */\n\nexport function projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n}\n/**\n * Returns a string representation of a mat3\n *\n * @param {ReadonlyMat3} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\n\nexport function str(a) {\n return \"mat3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \")\";\n}\n/**\n * Returns Frobenius norm of a mat3\n *\n * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);\n}\n/**\n * Adds two mat3's\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n}\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n}\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat3} out\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n}\n/**\n * Adds two mat3's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat3} out the receiving vector\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat3} out\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n}\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat3} a The first matrix.\n * @param {ReadonlyMat3} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];\n}\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat3} a The first matrix.\n * @param {ReadonlyMat3} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7],\n a8 = a[8];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7],\n b8 = b[8];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8));\n}\n/**\n * Alias for {@link mat3.multiply}\n * @function\n */\n\nexport var mul = multiply;\n/**\n * Alias for {@link mat3.subtract}\n * @function\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\n * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied.\n * @module mat4\n */\n\n/**\n * Creates a new identity mat4\n *\n * @returns {mat4} a new 4x4 matrix\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(16);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n }\n\n out[0] = 1;\n out[5] = 1;\n out[10] = 1;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a new mat4 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat4} a matrix to clone\n * @returns {mat4} a new 4x4 matrix\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\n * Copy the values from one mat4 to another\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\n * Create a new mat4 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\n * @returns {mat4} A new mat4\n */\n\nexport function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\n * Set the components of a mat4 to the given values\n *\n * @param {mat4} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\n * @returns {mat4} out\n */\n\nexport function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\n * Set a mat4 to the identity matrix\n *\n * @param {mat4} out the receiving matrix\n * @returns {mat4} out\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Transpose the values of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a12 = a[6],\n a13 = a[7];\n var a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\n * Inverts a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nexport function invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n}\n/**\n * Calculates the adjugate of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nexport function adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22);\n out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\n out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12);\n out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\n out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\n out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22);\n out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\n out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12);\n out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21);\n out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\n out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11);\n out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\n out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\n out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21);\n out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\n out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11);\n return out;\n}\n/**\n * Calculates the determinant of a mat4\n *\n * @param {ReadonlyMat4} a the source matrix\n * @returns {Number} determinant of a\n */\n\nexport function determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n}\n/**\n * Multiplies two mat4s\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nexport function multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15]; // Cache only the current line of the second matrix\n\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n/**\n * Translate a mat4 by the given vector\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to translate\n * @param {ReadonlyVec3} v vector to translate by\n * @returns {mat4} out\n */\n\nexport function translate(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n\n return out;\n}\n/**\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to scale\n * @param {ReadonlyVec3} v the vec3 to scale the matrix by\n * @returns {mat4} out\n **/\n\nexport function scale(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\n * Rotates a mat4 by the given angle around the given axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @param {ReadonlyVec3} axis the axis to rotate around\n * @returns {mat4} out\n */\n\nexport function rotate(out, a, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n var b00, b01, b02;\n var b10, b11, b12;\n var b20, b21, b22;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11]; // Construct the elements of the rotation matrix\n\n b00 = x * x * t + c;\n b01 = y * x * t + z * s;\n b02 = z * x * t - y * s;\n b10 = x * y * t - z * s;\n b11 = y * y * t + c;\n b12 = z * y * t + x * s;\n b20 = x * z * t + y * s;\n b21 = y * z * t - x * s;\n b22 = z * z * t + c; // Perform rotation-specific matrix multiplication\n\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\n * Rotates a matrix by the given angle around the X axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nexport function rotateX(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n}\n/**\n * Rotates a matrix by the given angle around the Y axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nexport function rotateY(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n}\n/**\n * Rotates a matrix by the given angle around the Z axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nexport function rotateZ(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n}\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyVec3} v Translation vector\n * @returns {mat4} out\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyVec3} v Scaling vector\n * @returns {mat4} out\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @param {ReadonlyVec3} axis the axis to rotate around\n * @returns {mat4} out\n */\n\nexport function fromRotation(out, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c; // Perform rotation-specific matrix multiplication\n\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nexport function fromXRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nexport function fromYRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nexport function fromZRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @returns {mat4} out\n */\n\nexport function fromRotationTranslation(out, q, v) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\n * Creates a new mat4 from a dual quat.\n *\n * @param {mat4} out Matrix\n * @param {ReadonlyQuat2} a Dual Quaternion\n * @returns {mat4} mat4 receiving operation result\n */\n\nexport function fromQuat2(out, a) {\n var translation = new glMatrix.ARRAY_TYPE(3);\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense\n\n if (magnitude > 0) {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n\n fromRotationTranslation(out, a, translation);\n return out;\n}\n/**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n\nexport function getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n}\n/**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion paramter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n\nexport function getScaling(out, mat) {\n var m11 = mat[0];\n var m12 = mat[1];\n var m13 = mat[2];\n var m21 = mat[4];\n var m22 = mat[5];\n var m23 = mat[6];\n var m31 = mat[8];\n var m32 = mat[9];\n var m33 = mat[10];\n out[0] = Math.hypot(m11, m12, m13);\n out[1] = Math.hypot(m21, m22, m23);\n out[2] = Math.hypot(m31, m32, m33);\n return out;\n}\n/**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @param {quat} out Quaternion to receive the rotation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {quat} out\n */\n\nexport function getRotation(out, mat) {\n var scaling = new glMatrix.ARRAY_TYPE(3);\n getScaling(scaling, mat);\n var is1 = 1 / scaling[0];\n var is2 = 1 / scaling[1];\n var is3 = 1 / scaling[2];\n var sm11 = mat[0] * is1;\n var sm12 = mat[1] * is2;\n var sm13 = mat[2] * is3;\n var sm21 = mat[4] * is1;\n var sm22 = mat[5] * is2;\n var sm23 = mat[6] * is3;\n var sm31 = mat[8] * is1;\n var sm32 = mat[9] * is2;\n var sm33 = mat[10] * is3;\n var trace = sm11 + sm22 + sm33;\n var S = 0;\n\n if (trace > 0) {\n S = Math.sqrt(trace + 1.0) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n\n return out;\n}\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @param {ReadonlyVec3} s Scaling vector\n * @returns {mat4} out\n */\n\nexport function fromRotationTranslationScale(out, q, v, s) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @param {ReadonlyVec3} s Scaling vector\n * @param {ReadonlyVec3} o The origin vector around which to scale and rotate\n * @returns {mat4} out\n */\n\nexport function fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n var ox = o[0];\n var oy = o[1];\n var oz = o[2];\n var out0 = (1 - (yy + zz)) * sx;\n var out1 = (xy + wz) * sx;\n var out2 = (xz - wy) * sx;\n var out4 = (xy - wz) * sy;\n var out5 = (1 - (xx + zz)) * sy;\n var out6 = (yz + wx) * sy;\n var out8 = (xz + wy) * sz;\n var out9 = (yz - wx) * sz;\n var out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n}\n/**\n * Calculates a 4x4 matrix from the given quaternion\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyQuat} q Quaternion to create matrix from\n *\n * @returns {mat4} out\n */\n\nexport function fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Generates a frustum matrix with the given bounds\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {Number} left Left bound of the frustum\n * @param {Number} right Right bound of the frustum\n * @param {Number} bottom Bottom bound of the frustum\n * @param {Number} top Top bound of the frustum\n * @param {Number} near Near bound of the frustum\n * @param {Number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nexport function frustum(out, left, right, bottom, top, near, far) {\n var rl = 1 / (right - left);\n var tb = 1 / (top - bottom);\n var nf = 1 / (near - far);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near * 2 * nf;\n out[15] = 0;\n return out;\n}\n/**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fovy Vertical field of view in radians\n * @param {number} aspect Aspect ratio. typically viewport width/height\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum, can be null or Infinity\n * @returns {mat4} out\n */\n\nexport function perspectiveNO(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n\n return out;\n}\n/**\n * Alias for {@link mat4.perspectiveNO}\n * @function\n */\n\nexport var perspective = perspectiveNO;\n/**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fovy Vertical field of view in radians\n * @param {number} aspect Aspect ratio. typically viewport width/height\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum, can be null or Infinity\n * @returns {mat4} out\n */\n\nexport function perspectiveZO(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n\n return out;\n}\n/**\n * Generates a perspective projection matrix with the given field of view.\n * This is primarily useful for generating projection matrices to be used\n * with the still experiemental WebVR API.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nexport function perspectiveFromFieldOfView(out, fov, near, far) {\n var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);\n var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);\n var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);\n var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);\n var xScale = 2.0 / (leftTan + rightTan);\n var yScale = 2.0 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n out[4] = 0.0;\n out[5] = yScale;\n out[6] = 0.0;\n out[7] = 0.0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1.0;\n out[12] = 0.0;\n out[13] = 0.0;\n out[14] = far * near / (near - far);\n out[15] = 0.0;\n return out;\n}\n/**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nexport function orthoNO(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n/**\n * Alias for {@link mat4.orthoNO}\n * @function\n */\n\nexport var ortho = orthoNO;\n/**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nexport function orthoZO(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n}\n/**\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {ReadonlyVec3} eye Position of the viewer\n * @param {ReadonlyVec3} center Point the viewer is looking at\n * @param {ReadonlyVec3} up vec3 pointing up\n * @returns {mat4} out\n */\n\nexport function lookAt(out, eye, center, up) {\n var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;\n var eyex = eye[0];\n var eyey = eye[1];\n var eyez = eye[2];\n var upx = up[0];\n var upy = up[1];\n var upz = up[2];\n var centerx = center[0];\n var centery = center[1];\n var centerz = center[2];\n\n if (Math.abs(eyex - centerx) < glMatrix.EPSILON && Math.abs(eyey - centery) < glMatrix.EPSILON && Math.abs(eyez - centerz) < glMatrix.EPSILON) {\n return identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n len = 1 / Math.hypot(z0, z1, z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.hypot(x0, x1, x2);\n\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n len = Math.hypot(y0, y1, y2);\n\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n}\n/**\n * Generates a matrix that makes something look at something else.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {ReadonlyVec3} eye Position of the viewer\n * @param {ReadonlyVec3} center Point the viewer is looking at\n * @param {ReadonlyVec3} up vec3 pointing up\n * @returns {mat4} out\n */\n\nexport function targetTo(out, eye, target, up) {\n var eyex = eye[0],\n eyey = eye[1],\n eyez = eye[2],\n upx = up[0],\n upy = up[1],\n upz = up[2];\n var z0 = eyex - target[0],\n z1 = eyey - target[1],\n z2 = eyez - target[2];\n var len = z0 * z0 + z1 * z1 + z2 * z2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n\n var x0 = upy * z2 - upz * z1,\n x1 = upz * z0 - upx * z2,\n x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n}\n/**\n * Returns a string representation of a mat4\n *\n * @param {ReadonlyMat4} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\n\nexport function str(a) {\n return \"mat4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \", \" + a[9] + \", \" + a[10] + \", \" + a[11] + \", \" + a[12] + \", \" + a[13] + \", \" + a[14] + \", \" + a[15] + \")\";\n}\n/**\n * Returns Frobenius norm of a mat4\n *\n * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);\n}\n/**\n * Adds two mat4's\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n}\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n}\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat4} out\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n}\n/**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat4} out the receiving vector\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat4} out\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n}\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat4} a The first matrix.\n * @param {ReadonlyMat4} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];\n}\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat4} a The first matrix.\n * @param {ReadonlyMat4} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var a8 = a[8],\n a9 = a[9],\n a10 = a[10],\n a11 = a[11];\n var a12 = a[12],\n a13 = a[13],\n a14 = a[14],\n a15 = a[15];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n var b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n var b8 = b[8],\n b9 = b[9],\n b10 = b[10],\n b11 = b[11];\n var b12 = b[12],\n b13 = b[13],\n b14 = b[14],\n b15 = b[15];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15));\n}\n/**\n * Alias for {@link mat4.multiply}\n * @function\n */\n\nexport var mul = multiply;\n/**\n * Alias for {@link mat4.subtract}\n * @function\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\n * 3 Dimensional Vector\n * @module vec3\n */\n\n/**\n * Creates a new, empty vec3\n *\n * @returns {vec3} a new 3D vector\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(3);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n return out;\n}\n/**\n * Creates a new vec3 initialized with values from an existing vector\n *\n * @param {ReadonlyVec3} a vector to clone\n * @returns {vec3} a new 3D vector\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\n * Calculates the length of a vec3\n *\n * @param {ReadonlyVec3} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nexport function length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return Math.hypot(x, y, z);\n}\n/**\n * Creates a new vec3 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} a new 3D vector\n */\n\nexport function fromValues(x, y, z) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\n * Copy the values from one vec3 to another\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the source vector\n * @returns {vec3} out\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\n * Set the components of a vec3 to the given values\n *\n * @param {vec3} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} out\n */\n\nexport function set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\n * Adds two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n}\n/**\n * Multiplies two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n}\n/**\n * Divides two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n}\n/**\n * Math.ceil the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to ceil\n * @returns {vec3} out\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n}\n/**\n * Math.floor the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to floor\n * @returns {vec3} out\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n}\n/**\n * Returns the minimum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n}\n/**\n * Returns the maximum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n}\n/**\n * Math.round the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to round\n * @returns {vec3} out\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n return out;\n}\n/**\n * Scales a vec3 by a scalar number\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec3} out\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n return out;\n}\n/**\n * Adds two vec3's after scaling the second operand by a scalar value\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec3} out\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n}\n/**\n * Calculates the euclidian distance between two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} distance between a and b\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return Math.hypot(x, y, z);\n}\n/**\n * Calculates the squared euclidian distance between two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} squared distance between a and b\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return x * x + y * y + z * z;\n}\n/**\n * Calculates the squared length of a vec3\n *\n * @param {ReadonlyVec3} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\n\nexport function squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return x * x + y * y + z * z;\n}\n/**\n * Negates the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to negate\n * @returns {vec3} out\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n}\n/**\n * Returns the inverse of the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to invert\n * @returns {vec3} out\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n return out;\n}\n/**\n * Normalize a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to normalize\n * @returns {vec3} out\n */\n\nexport function normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var len = x * x + y * y + z * z;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n}\n/**\n * Calculates the dot product of two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} dot product of a and b\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n/**\n * Computes the cross product of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nexport function cross(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2];\n var bx = b[0],\n by = b[1],\n bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n}\n/**\n * Performs a linear interpolation between two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n}\n/**\n * Performs a hermite interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {ReadonlyVec3} c the third operand\n * @param {ReadonlyVec3} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\n\nexport function hermite(out, a, b, c, d, t) {\n var factorTimes2 = t * t;\n var factor1 = factorTimes2 * (2 * t - 3) + 1;\n var factor2 = factorTimes2 * (t - 2) + t;\n var factor3 = factorTimes2 * (t - 1);\n var factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\n * Performs a bezier interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {ReadonlyVec3} c the third operand\n * @param {ReadonlyVec3} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\n\nexport function bezier(out, a, b, c, d, t) {\n var inverseFactor = 1 - t;\n var inverseFactorTimesTwo = inverseFactor * inverseFactor;\n var factorTimes2 = t * t;\n var factor1 = inverseFactorTimesTwo * inverseFactor;\n var factor2 = 3 * t * inverseFactorTimesTwo;\n var factor3 = 3 * factorTimes2 * inverseFactor;\n var factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec3} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec3} out\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n var z = glMatrix.RANDOM() * 2.0 - 1.0;\n var zScale = Math.sqrt(1.0 - z * z) * scale;\n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n}\n/**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec3} out\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n/**\n * Transforms the vec3 with a mat3.\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat3} m the 3x3 matrix to transform with\n * @returns {vec3} out\n */\n\nexport function transformMat3(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n}\n/**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyQuat} q quaternion to transform with\n * @returns {vec3} out\n */\n\nexport function transformQuat(out, a, q) {\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3];\n var x = a[0],\n y = a[1],\n z = a[2]; // var qvec = [qx, qy, qz];\n // var uv = vec3.cross([], qvec, a);\n\n var uvx = qy * z - qz * y,\n uvy = qz * x - qx * z,\n uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv);\n\n var uuvx = qy * uvz - qz * uvy,\n uuvy = qz * uvx - qx * uvz,\n uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w);\n\n var w2 = qw * 2;\n uvx *= w2;\n uvy *= w2;\n uvz *= w2; // vec3.scale(uuv, uuv, 2);\n\n uuvx *= 2;\n uuvy *= 2;\n uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv));\n\n out[0] = x + uvx + uuvx;\n out[1] = y + uvy + uuvy;\n out[2] = z + uvz + uuvz;\n return out;\n}\n/**\n * Rotate a 3D vector around the x-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\n\nexport function rotateX(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\n * Rotate a 3D vector around the y-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\n\nexport function rotateY(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\n * Rotate a 3D vector around the z-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\n\nexport function rotateZ(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2]; //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\n * Get the angle between two 3D vectors\n * @param {ReadonlyVec3} a The first operand\n * @param {ReadonlyVec3} b The second operand\n * @returns {Number} The angle in radians\n */\n\nexport function angle(a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n bx = b[0],\n by = b[1],\n bz = b[2],\n mag1 = Math.sqrt(ax * ax + ay * ay + az * az),\n mag2 = Math.sqrt(bx * bx + by * by + bz * bz),\n mag = mag1 * mag2,\n cosine = mag && dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\n * Set the components of a vec3 to zero\n *\n * @param {vec3} out the receiving vector\n * @returns {vec3} out\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec3} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nexport function str(a) {\n return \"vec3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \")\";\n}\n/**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec3} a The first vector.\n * @param {ReadonlyVec3} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec3} a The first vector.\n * @param {ReadonlyVec3} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2));\n}\n/**\n * Alias for {@link vec3.subtract}\n * @function\n */\n\nexport var sub = subtract;\n/**\n * Alias for {@link vec3.multiply}\n * @function\n */\n\nexport var mul = multiply;\n/**\n * Alias for {@link vec3.divide}\n * @function\n */\n\nexport var div = divide;\n/**\n * Alias for {@link vec3.distance}\n * @function\n */\n\nexport var dist = distance;\n/**\n * Alias for {@link vec3.squaredDistance}\n * @function\n */\n\nexport var sqrDist = squaredDistance;\n/**\n * Alias for {@link vec3.length}\n * @function\n */\n\nexport var len = length;\n/**\n * Alias for {@link vec3.squaredLength}\n * @function\n */\n\nexport var sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec3s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 3;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n }\n\n return a;\n };\n}();","import * as glMatrix from \"./common.js\";\n/**\n * 4 Dimensional Vector\n * @module vec4\n */\n\n/**\n * Creates a new, empty vec4\n *\n * @returns {vec4} a new 4D vector\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n }\n\n return out;\n}\n/**\n * Creates a new vec4 initialized with values from an existing vector\n *\n * @param {ReadonlyVec4} a vector to clone\n * @returns {vec4} a new 4D vector\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Creates a new vec4 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} a new 4D vector\n */\n\nexport function fromValues(x, y, z, w) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\n * Copy the values from one vec4 to another\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the source vector\n * @returns {vec4} out\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Set the components of a vec4 to the given values\n *\n * @param {vec4} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} out\n */\n\nexport function set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\n * Adds two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\n * Multiplies two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n}\n/**\n * Divides two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n}\n/**\n * Math.ceil the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to ceil\n * @returns {vec4} out\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n}\n/**\n * Math.floor the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to floor\n * @returns {vec4} out\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n}\n/**\n * Returns the minimum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n}\n/**\n * Returns the maximum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n}\n/**\n * Math.round the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to round\n * @returns {vec4} out\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n}\n/**\n * Scales a vec4 by a scalar number\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec4} out\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\n * Adds two vec4's after scaling the second operand by a scalar value\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec4} out\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\n * Calculates the euclidian distance between two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} distance between a and b\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\n * Calculates the squared euclidian distance between two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} squared distance between a and b\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\n * Calculates the length of a vec4\n *\n * @param {ReadonlyVec4} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nexport function length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\n * Calculates the squared length of a vec4\n *\n * @param {ReadonlyVec4} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\n\nexport function squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\n * Negates the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to negate\n * @returns {vec4} out\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n}\n/**\n * Returns the inverse of the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to invert\n * @returns {vec4} out\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n out[3] = 1.0 / a[3];\n return out;\n}\n/**\n * Normalize a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to normalize\n * @returns {vec4} out\n */\n\nexport function normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n var len = x * x + y * y + z * z + w * w;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n}\n/**\n * Calculates the dot product of two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} dot product of a and b\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n}\n/**\n * Returns the cross-product of three vectors in a 4-dimensional space\n *\n * @param {ReadonlyVec4} result the receiving vector\n * @param {ReadonlyVec4} U the first vector\n * @param {ReadonlyVec4} V the second vector\n * @param {ReadonlyVec4} W the third vector\n * @returns {vec4} result\n */\n\nexport function cross(out, u, v, w) {\n var A = v[0] * w[1] - v[1] * w[0],\n B = v[0] * w[2] - v[2] * w[0],\n C = v[0] * w[3] - v[3] * w[0],\n D = v[1] * w[2] - v[2] * w[1],\n E = v[1] * w[3] - v[3] * w[1],\n F = v[2] * w[3] - v[3] * w[2];\n var G = u[0];\n var H = u[1];\n var I = u[2];\n var J = u[3];\n out[0] = H * F - I * E + J * D;\n out[1] = -(G * F) + I * C - J * B;\n out[2] = G * E - H * C + J * A;\n out[3] = -(G * D) + H * B - I * A;\n return out;\n}\n/**\n * Performs a linear interpolation between two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec4} out\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n var aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec4} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec4} out\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n\n var v1, v2, v3, v4;\n var s1, s2;\n\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n\n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n}\n/**\n * Transforms the vec4 with a mat4.\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec4} out\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n}\n/**\n * Transforms the vec4 with a quat\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to transform\n * @param {ReadonlyQuat} q quaternion to transform with\n * @returns {vec4} out\n */\n\nexport function transformQuat(out, a, q) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3]; // calculate quat * vec\n\n var ix = qw * x + qy * z - qz * y;\n var iy = qw * y + qz * x - qx * z;\n var iz = qw * z + qx * y - qy * x;\n var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n}\n/**\n * Set the components of a vec4 to zero\n *\n * @param {vec4} out the receiving vector\n * @returns {vec4} out\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec4} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nexport function str(a) {\n return \"vec4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec4} a The first vector.\n * @param {ReadonlyVec4} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec4} a The first vector.\n * @param {ReadonlyVec4} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\n * Alias for {@link vec4.subtract}\n * @function\n */\n\nexport var sub = subtract;\n/**\n * Alias for {@link vec4.multiply}\n * @function\n */\n\nexport var mul = multiply;\n/**\n * Alias for {@link vec4.divide}\n * @function\n */\n\nexport var div = divide;\n/**\n * Alias for {@link vec4.distance}\n * @function\n */\n\nexport var dist = distance;\n/**\n * Alias for {@link vec4.squaredDistance}\n * @function\n */\n\nexport var sqrDist = squaredDistance;\n/**\n * Alias for {@link vec4.length}\n * @function\n */\n\nexport var len = length;\n/**\n * Alias for {@link vec4.squaredLength}\n * @function\n */\n\nexport var sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec4s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 4;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n vec[3] = a[i + 3];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n a[i + 3] = vec[3];\n }\n\n return a;\n };\n}();","import * as glMatrix from \"./common.js\";\nimport * as mat3 from \"./mat3.js\";\nimport * as vec3 from \"./vec3.js\";\nimport * as vec4 from \"./vec4.js\";\n/**\n * Quaternion\n * @module quat\n */\n\n/**\n * Creates a new identity quat\n *\n * @returns {quat} a new quaternion\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n out[3] = 1;\n return out;\n}\n/**\n * Set a quat to the identity quaternion\n *\n * @param {quat} out the receiving quaternion\n * @returns {quat} out\n */\n\nexport function identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyVec3} axis the axis around which to rotate\n * @param {Number} rad the angle in radians\n * @returns {quat} out\n **/\n\nexport function setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n var s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n}\n/**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as providied in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @param {vec3} out_axis Vector receiving the axis of rotation\n * @param {ReadonlyQuat} q Quaternion to be decomposed\n * @return {Number} Angle, in radians, of the rotation\n */\n\nexport function getAxisAngle(out_axis, q) {\n var rad = Math.acos(q[3]) * 2.0;\n var s = Math.sin(rad / 2.0);\n\n if (s > glMatrix.EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n // If s is zero, return any axis (no rotation - axis does not matter)\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n\n return rad;\n}\n/**\n * Gets the angular distance between two unit quaternions\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n\nexport function getAngle(a, b) {\n var dotproduct = dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n}\n/**\n * Multiplies two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @returns {quat} out\n */\n\nexport function multiply(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\n * Rotates a quaternion by the given angle about the X axis\n *\n * @param {quat} out quat receiving operation result\n * @param {ReadonlyQuat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\n\nexport function rotateX(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n}\n/**\n * Rotates a quaternion by the given angle about the Y axis\n *\n * @param {quat} out quat receiving operation result\n * @param {ReadonlyQuat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\n\nexport function rotateY(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var by = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n}\n/**\n * Rotates a quaternion by the given angle about the Z axis\n *\n * @param {quat} out quat receiving operation result\n * @param {ReadonlyQuat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\n\nexport function rotateZ(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bz = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n}\n/**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate W component of\n * @returns {quat} out\n */\n\nexport function calculateW(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\n return out;\n}\n/**\n * Calculate the exponential of a unit quaternion.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate the exponential of\n * @returns {quat} out\n */\n\nexport function exp(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var et = Math.exp(w);\n var s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n}\n/**\n * Calculate the natural logarithm of a unit quaternion.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate the exponential of\n * @returns {quat} out\n */\n\nexport function ln(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n}\n/**\n * Calculate the scalar power of a unit quaternion.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate the exponential of\n * @param {Number} b amount to scale the quaternion by\n * @returns {quat} out\n */\n\nexport function pow(out, a, b) {\n ln(out, a);\n scale(out, out, b);\n exp(out, out);\n return out;\n}\n/**\n * Performs a spherical linear interpolation between two quat\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat} out\n */\n\nexport function slerp(out, a, b, t) {\n // benchmarks:\n // http://jsperf.com/quaternion-slerp-implementations\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n var omega, cosom, sinom, scale0, scale1; // calc cosine\n\n cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary)\n\n if (cosom < 0.0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n } // calculate coefficients\n\n\n if (1.0 - cosom > glMatrix.EPSILON) {\n // standard case (slerp)\n omega = Math.acos(cosom);\n sinom = Math.sin(omega);\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n // \"from\" and \"to\" quaternions are very close\n // ... so we can do a linear interpolation\n scale0 = 1.0 - t;\n scale1 = t;\n } // calculate final values\n\n\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n}\n/**\n * Generates a random unit quaternion\n *\n * @param {quat} out the receiving quaternion\n * @returns {quat} out\n */\n\nexport function random(out) {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n var u1 = glMatrix.RANDOM();\n var u2 = glMatrix.RANDOM();\n var u3 = glMatrix.RANDOM();\n var sqrt1MinusU1 = Math.sqrt(1 - u1);\n var sqrtU1 = Math.sqrt(u1);\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n}\n/**\n * Calculates the inverse of a quat\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate inverse of\n * @returns {quat} out\n */\n\nexport function invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\n\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n}\n/**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate conjugate of\n * @returns {quat} out\n */\n\nexport function conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to renormalize the quaternion yourself where necessary.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyMat3} m rotation matrix\n * @returns {quat} out\n * @function\n */\n\nexport function fromMat3(out, m) {\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n var fTrace = m[0] + m[4] + m[8];\n var fRoot;\n\n if (fTrace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\n\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot; // 1/(4w)\n\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n // |w| <= 1/2\n var i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n var j = (i + 1) % 3;\n var k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n\n return out;\n}\n/**\n * Creates a quaternion from the given euler angle x, y, z.\n *\n * @param {quat} out the receiving quaternion\n * @param {x} Angle to rotate around X axis in degrees.\n * @param {y} Angle to rotate around Y axis in degrees.\n * @param {z} Angle to rotate around Z axis in degrees.\n * @returns {quat} out\n * @function\n */\n\nexport function fromEuler(out, x, y, z) {\n var halfToRad = 0.5 * Math.PI / 180.0;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n var sx = Math.sin(x);\n var cx = Math.cos(x);\n var sy = Math.sin(y);\n var cy = Math.cos(y);\n var sz = Math.sin(z);\n var cz = Math.cos(z);\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n return out;\n}\n/**\n * Returns a string representation of a quatenion\n *\n * @param {ReadonlyQuat} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nexport function str(a) {\n return \"quat(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\n * Creates a new quat initialized with values from an existing quaternion\n *\n * @param {ReadonlyQuat} a quaternion to clone\n * @returns {quat} a new quaternion\n * @function\n */\n\nexport var clone = vec4.clone;\n/**\n * Creates a new quat initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {quat} a new quaternion\n * @function\n */\n\nexport var fromValues = vec4.fromValues;\n/**\n * Copy the values from one quat to another\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the source quaternion\n * @returns {quat} out\n * @function\n */\n\nexport var copy = vec4.copy;\n/**\n * Set the components of a quat to the given values\n *\n * @param {quat} out the receiving quaternion\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {quat} out\n * @function\n */\n\nexport var set = vec4.set;\n/**\n * Adds two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @returns {quat} out\n * @function\n */\n\nexport var add = vec4.add;\n/**\n * Alias for {@link quat.multiply}\n * @function\n */\n\nexport var mul = multiply;\n/**\n * Scales a quat by a scalar number\n *\n * @param {quat} out the receiving vector\n * @param {ReadonlyQuat} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {quat} out\n * @function\n */\n\nexport var scale = vec4.scale;\n/**\n * Calculates the dot product of two quat's\n *\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @returns {Number} dot product of a and b\n * @function\n */\n\nexport var dot = vec4.dot;\n/**\n * Performs a linear interpolation between two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat} out\n * @function\n */\n\nexport var lerp = vec4.lerp;\n/**\n * Calculates the length of a quat\n *\n * @param {ReadonlyQuat} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nexport var length = vec4.length;\n/**\n * Alias for {@link quat.length}\n * @function\n */\n\nexport var len = length;\n/**\n * Calculates the squared length of a quat\n *\n * @param {ReadonlyQuat} a vector to calculate squared length of\n * @returns {Number} squared length of a\n * @function\n */\n\nexport var squaredLength = vec4.squaredLength;\n/**\n * Alias for {@link quat.squaredLength}\n * @function\n */\n\nexport var sqrLen = squaredLength;\n/**\n * Normalize a quat\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quaternion to normalize\n * @returns {quat} out\n * @function\n */\n\nexport var normalize = vec4.normalize;\n/**\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyQuat} a The first quaternion.\n * @param {ReadonlyQuat} b The second quaternion.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport var exactEquals = vec4.exactEquals;\n/**\n * Returns whether or not the quaternions have approximately the same elements in the same position.\n *\n * @param {ReadonlyQuat} a The first vector.\n * @param {ReadonlyQuat} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport var equals = vec4.equals;\n/**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n *\n * @param {quat} out the receiving quaternion.\n * @param {ReadonlyVec3} a the initial vector\n * @param {ReadonlyVec3} b the destination vector\n * @returns {quat} out\n */\n\nexport var rotationTo = function () {\n var tmpvec3 = vec3.create();\n var xUnitVec3 = vec3.fromValues(1, 0, 0);\n var yUnitVec3 = vec3.fromValues(0, 1, 0);\n return function (out, a, b) {\n var dot = vec3.dot(a, b);\n\n if (dot < -0.999999) {\n vec3.cross(tmpvec3, xUnitVec3, a);\n if (vec3.len(tmpvec3) < 0.000001) vec3.cross(tmpvec3, yUnitVec3, a);\n vec3.normalize(tmpvec3, tmpvec3);\n setAxisAngle(out, tmpvec3, Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n vec3.cross(tmpvec3, a, b);\n out[0] = tmpvec3[0];\n out[1] = tmpvec3[1];\n out[2] = tmpvec3[2];\n out[3] = 1 + dot;\n return normalize(out, out);\n }\n };\n}();\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @param {ReadonlyQuat} c the third operand\n * @param {ReadonlyQuat} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat} out\n */\n\nexport var sqlerp = function () {\n var temp1 = create();\n var temp2 = create();\n return function (out, a, b, c, d, t) {\n slerp(temp1, a, d, t);\n slerp(temp2, b, c, t);\n slerp(out, temp1, temp2, 2 * t * (1 - t));\n return out;\n };\n}();\n/**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n *\n * @param {ReadonlyVec3} view the vector representing the viewing direction\n * @param {ReadonlyVec3} right the vector representing the local \"right\" direction\n * @param {ReadonlyVec3} up the vector representing the local \"up\" direction\n * @returns {quat} out\n */\n\nexport var setAxes = function () {\n var matr = mat3.create();\n return function (out, view, right, up) {\n matr[0] = right[0];\n matr[3] = right[1];\n matr[6] = right[2];\n matr[1] = up[0];\n matr[4] = up[1];\n matr[7] = up[2];\n matr[2] = -view[0];\n matr[5] = -view[1];\n matr[8] = -view[2];\n return normalize(out, fromMat3(out, matr));\n };\n}();","import * as glMatrix from \"./common.js\";\n/**\n * 2 Dimensional Vector\n * @module vec2\n */\n\n/**\n * Creates a new, empty vec2\n *\n * @returns {vec2} a new 2D vector\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(2);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n }\n\n return out;\n}\n/**\n * Creates a new vec2 initialized with values from an existing vector\n *\n * @param {ReadonlyVec2} a vector to clone\n * @returns {vec2} a new 2D vector\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\n * Creates a new vec2 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} a new 2D vector\n */\n\nexport function fromValues(x, y) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\n * Copy the values from one vec2 to another\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the source vector\n * @returns {vec2} out\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\n * Set the components of a vec2 to the given values\n *\n * @param {vec2} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} out\n */\n\nexport function set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\n * Adds two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n}\n/**\n * Multiplies two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n}\n/**\n * Divides two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n}\n/**\n * Math.ceil the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to ceil\n * @returns {vec2} out\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n}\n/**\n * Math.floor the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to floor\n * @returns {vec2} out\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n}\n/**\n * Returns the minimum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n}\n/**\n * Returns the maximum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n}\n/**\n * Math.round the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to round\n * @returns {vec2} out\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n}\n/**\n * Scales a vec2 by a scalar number\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec2} out\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n}\n/**\n * Adds two vec2's after scaling the second operand by a scalar value\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec2} out\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n}\n/**\n * Calculates the euclidian distance between two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} distance between a and b\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return Math.hypot(x, y);\n}\n/**\n * Calculates the squared euclidian distance between two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} squared distance between a and b\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return x * x + y * y;\n}\n/**\n * Calculates the length of a vec2\n *\n * @param {ReadonlyVec2} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nexport function length(a) {\n var x = a[0],\n y = a[1];\n return Math.hypot(x, y);\n}\n/**\n * Calculates the squared length of a vec2\n *\n * @param {ReadonlyVec2} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\n\nexport function squaredLength(a) {\n var x = a[0],\n y = a[1];\n return x * x + y * y;\n}\n/**\n * Negates the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to negate\n * @returns {vec2} out\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n}\n/**\n * Returns the inverse of the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to invert\n * @returns {vec2} out\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n return out;\n}\n/**\n * Normalize a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to normalize\n * @returns {vec2} out\n */\n\nexport function normalize(out, a) {\n var x = a[0],\n y = a[1];\n var len = x * x + y * y;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n}\n/**\n * Calculates the dot product of two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} dot product of a and b\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n}\n/**\n * Computes the cross product of two vec2's\n * Note that the cross product must by definition produce a 3D vector\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec3} out\n */\n\nexport function cross(out, a, b) {\n var z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n}\n/**\n * Performs a linear interpolation between two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec2} out\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0],\n ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec2} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec2} out\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n out[0] = Math.cos(r) * scale;\n out[1] = Math.sin(r) * scale;\n return out;\n}\n/**\n * Transforms the vec2 with a mat2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat2} m matrix to transform with\n * @returns {vec2} out\n */\n\nexport function transformMat2(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n}\n/**\n * Transforms the vec2 with a mat2d\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat2d} m matrix to transform with\n * @returns {vec2} out\n */\n\nexport function transformMat2d(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\n/**\n * Transforms the vec2 with a mat3\n * 3rd vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat3} m matrix to transform with\n * @returns {vec2} out\n */\n\nexport function transformMat3(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n}\n/**\n * Transforms the vec2 with a mat4\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec2} out\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0];\n var y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n}\n/**\n * Rotate a 2D vector\n * @param {vec2} out The receiving vec2\n * @param {ReadonlyVec2} a The vec2 point to rotate\n * @param {ReadonlyVec2} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec2} out\n */\n\nexport function rotate(out, a, b, rad) {\n //Translate point to the origin\n var p0 = a[0] - b[0],\n p1 = a[1] - b[1],\n sinC = Math.sin(rad),\n cosC = Math.cos(rad); //perform rotation and translate to correct position\n\n out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n}\n/**\n * Get the angle between two 2D vectors\n * @param {ReadonlyVec2} a The first operand\n * @param {ReadonlyVec2} b The second operand\n * @returns {Number} The angle in radians\n */\n\nexport function angle(a, b) {\n var x1 = a[0],\n y1 = a[1],\n x2 = b[0],\n y2 = b[1],\n // mag is the product of the magnitudes of a and b\n mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2),\n // mag &&.. short circuits if mag == 0\n cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\n\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\n * Set the components of a vec2 to zero\n *\n * @param {vec2} out the receiving vector\n * @returns {vec2} out\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec2} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nexport function str(a) {\n return \"vec2(\" + a[0] + \", \" + a[1] + \")\";\n}\n/**\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec2} a The first vector.\n * @param {ReadonlyVec2} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec2} a The first vector.\n * @param {ReadonlyVec2} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1];\n var b0 = b[0],\n b1 = b[1];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1));\n}\n/**\n * Alias for {@link vec2.length}\n * @function\n */\n\nexport var len = length;\n/**\n * Alias for {@link vec2.subtract}\n * @function\n */\n\nexport var sub = subtract;\n/**\n * Alias for {@link vec2.multiply}\n * @function\n */\n\nexport var mul = multiply;\n/**\n * Alias for {@link vec2.divide}\n * @function\n */\n\nexport var div = divide;\n/**\n * Alias for {@link vec2.distance}\n * @function\n */\n\nexport var dist = distance;\n/**\n * Alias for {@link vec2.squaredDistance}\n * @function\n */\n\nexport var sqrDist = squaredDistance;\n/**\n * Alias for {@link vec2.squaredLength}\n * @function\n */\n\nexport var sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec2s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 2;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n }\n\n return a;\n };\n}();","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","export var paramsParser = {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n x: 0,\n y: 0,\n qx: null,\n qy: null,\n};\n//# sourceMappingURL=params-parser.js.map","export function fixArc(pathArray, allPathCommands, i) {\n if (pathArray[i].length > 7) {\n pathArray[i].shift();\n var pi = pathArray[i];\n // const ni = i + 1;\n var ni = i;\n while (pi.length) {\n // if created multiple C:s, their original seg is saved\n allPathCommands[i] = 'A';\n // @ts-ignore\n pathArray.splice((ni += 1), 0, ['C'].concat(pi.splice(0, 6)));\n }\n pathArray.splice(i, 1);\n }\n}\n//# sourceMappingURL=fix-arc.js.map","export var paramsCount = {\n a: 7,\n c: 6,\n h: 1,\n l: 2,\n m: 2,\n r: 4,\n q: 4,\n s: 4,\n t: 2,\n v: 1,\n z: 0,\n};\n//# sourceMappingURL=params-count.js.map","import { paramsCount } from '../parser/params-count';\n/**\n * Iterates an array to check if it's an actual `PathArray`.\n */\nexport function isPathArray(path) {\n return (Array.isArray(path) &&\n path.every(function (seg) {\n var lk = seg[0].toLowerCase();\n return paramsCount[lk] === seg.length - 1 && 'achlmqstvz'.includes(lk);\n }));\n}\n//# sourceMappingURL=is-path-array.js.map","import { isPathArray } from './is-path-array';\n/**\n * Iterates an array to check if it's a `PathArray`\n * with all absolute values.\n */\nexport function isAbsoluteArray(path) {\n return (isPathArray(path) &&\n // @ts-ignore -- `isPathArray` also checks if it's `Array`\n path.every(function (_a) {\n var x = _a[0];\n return x === x.toUpperCase();\n }));\n}\n//# sourceMappingURL=is-absolute-array.js.map","import { isAbsoluteArray } from './is-absolute-array';\n/**\n * Iterates an array to check if it's a `PathArray`\n * with all segments are in non-shorthand notation\n * with absolute values.\n */\nexport function isNormalizedArray(path) {\n return isAbsoluteArray(path) && path.every(function (_a) {\n var pc = _a[0];\n return 'ACLMQZ'.includes(pc);\n });\n}\n//# sourceMappingURL=is-normalized-array.js.map","import { paramsCount } from './params-count';\n/**\n * Breaks the parsing of a pathString once a segment is finalized.\n */\nexport function finalizeSegment(path) {\n var pathCommand = path.pathValue[path.segmentStart];\n var LK = pathCommand.toLowerCase();\n var data = path.data;\n while (data.length >= paramsCount[LK]) {\n // overloaded `moveTo`\n // https://github.com/rveciana/svg-path-properties/blob/master/src/parse.ts\n if (LK === 'm' && data.length > 2) {\n // @ts-ignore\n path.segments.push([pathCommand].concat(data.splice(0, 2)));\n LK = 'l';\n pathCommand = pathCommand === 'm' ? 'l' : 'L';\n }\n else {\n // @ts-ignore\n path.segments.push([pathCommand].concat(data.splice(0, paramsCount[LK])));\n }\n if (!paramsCount[LK]) {\n break;\n }\n }\n}\n//# sourceMappingURL=finalize-segment.js.map","/**\n * Validates an A (arc-to) specific path command value.\n * Usually a `large-arc-flag` or `sweep-flag`.\n */\nexport function scanFlag(path) {\n var index = path.index, pathValue = path.pathValue;\n var code = pathValue.charCodeAt(index);\n if (code === 0x30 /* 0 */) {\n path.param = 0;\n path.index += 1;\n return;\n }\n if (code === 0x31 /* 1 */) {\n path.param = 1;\n path.index += 1;\n return;\n }\n path.err = \"[path-util]: invalid Arc flag \\\"\" + pathValue[index] + \"\\\", expecting 0 or 1 at index \" + index;\n}\n//# sourceMappingURL=scan-flag.js.map","/**\n * Checks if the character is or belongs to a number.\n * [0-9]|+|-|.\n */\nexport function isDigitStart(code) {\n return ((code >= 48 && code <= 57) /* 0..9 */ || code === 0x2b /* + */ || code === 0x2d /* - */ || code === 0x2e); /* . */\n}\nexport function isDigit(code) {\n return code >= 48 && code <= 57; // 0..9\n}\n//# sourceMappingURL=is-digit-start.js.map","import { isDigit } from './is-digit-start';\n/**\n * Validates every character of the path string,\n * every path command, negative numbers or floating point numbers.\n */\nexport function scanParam(path) {\n var max = path.max, pathValue = path.pathValue, start = path.index;\n var index = start;\n var zeroFirst = false;\n var hasCeiling = false;\n var hasDecimal = false;\n var hasDot = false;\n var ch;\n if (index >= max) {\n // path.err = 'SvgPath: missed param (at pos ' + index + ')';\n path.err = \"[path-util]: Invalid path value at index \" + index + \", \\\"pathValue\\\" is missing param\";\n return;\n }\n ch = pathValue.charCodeAt(index);\n if (ch === 0x2b /* + */ || ch === 0x2d /* - */) {\n index += 1;\n // ch = (index < max) ? pathValue.charCodeAt(index) : 0;\n ch = pathValue.charCodeAt(index);\n }\n // This logic is shamelessly borrowed from Esprima\n // https://github.com/ariya/esprimas\n if (!isDigit(ch) && ch !== 0x2e /* . */) {\n // path.err = 'SvgPath: param should start with 0..9 or `.` (at pos ' + index + ')';\n path.err = \"[path-util]: Invalid path value at index \" + index + \", \\\"\" + pathValue[index] + \"\\\" is not a number\";\n return;\n }\n if (ch !== 0x2e /* . */) {\n zeroFirst = ch === 0x30 /* 0 */;\n index += 1;\n ch = pathValue.charCodeAt(index);\n if (zeroFirst && index < max) {\n // decimal number starts with '0' such as '09' is illegal.\n if (ch && isDigit(ch)) {\n // path.err = 'SvgPath: numbers started with `0` such as `09`\n // are illegal (at pos ' + start + ')';\n path.err = \"[path-util]: Invalid path value at index \" + start + \", \\\"\" + pathValue[start] + \"\\\" illegal number\";\n return;\n }\n }\n while (index < max && isDigit(pathValue.charCodeAt(index))) {\n index += 1;\n hasCeiling = true;\n }\n ch = pathValue.charCodeAt(index);\n }\n if (ch === 0x2e /* . */) {\n hasDot = true;\n index += 1;\n while (isDigit(pathValue.charCodeAt(index))) {\n index += 1;\n hasDecimal = true;\n }\n ch = pathValue.charCodeAt(index);\n }\n if (ch === 0x65 /* e */ || ch === 0x45 /* E */) {\n if (hasDot && !hasCeiling && !hasDecimal) {\n path.err = \"[path-util]: Invalid path value at index \" + index + \", \\\"\" + pathValue[index] + \"\\\" invalid float exponent\";\n return;\n }\n index += 1;\n ch = pathValue.charCodeAt(index);\n if (ch === 0x2b /* + */ || ch === 0x2d /* - */) {\n index += 1;\n }\n if (index < max && isDigit(pathValue.charCodeAt(index))) {\n while (index < max && isDigit(pathValue.charCodeAt(index))) {\n index += 1;\n }\n }\n else {\n path.err = \"[path-util]: Invalid path value at index \" + index + \", \\\"\" + pathValue[index] + \"\\\" invalid integer exponent\";\n return;\n }\n }\n path.index = index;\n path.param = +path.pathValue.slice(start, index);\n}\n//# sourceMappingURL=scan-param.js.map","/**\n * Checks if the character is a space.\n */\nexport function isSpace(ch) {\n var specialSpaces = [\n 0x1680, 0x180e, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200a, 0x202f,\n 0x205f, 0x3000, 0xfeff,\n ];\n /* istanbul ignore next */\n return (ch === 0x0a ||\n ch === 0x0d ||\n ch === 0x2028 ||\n ch === 0x2029 || // Line terminators\n // White spaces\n ch === 0x20 ||\n ch === 0x09 ||\n ch === 0x0b ||\n ch === 0x0c ||\n ch === 0xa0 ||\n (ch >= 0x1680 && specialSpaces.includes(ch)));\n}\n//# sourceMappingURL=is-space.js.map","import { isSpace } from './is-space';\n/**\n * Points the parser to the next character in the\n * path string every time it encounters any kind of\n * space character.\n */\nexport function skipSpaces(path) {\n var pathValue = path.pathValue, max = path.max;\n while (path.index < max && isSpace(pathValue.charCodeAt(path.index))) {\n path.index += 1;\n }\n}\n//# sourceMappingURL=skip-spaces.js.map","/**\n * Checks if the character is a path command.\n */\nexport function isPathCommand(code) {\n // eslint-disable-next-line no-bitwise -- Impossible to satisfy\n switch (code | 0x20) {\n case 0x6d /* m */:\n case 0x7a /* z */:\n case 0x6c /* l */:\n case 0x68 /* h */:\n case 0x76 /* v */:\n case 0x63 /* c */:\n case 0x73 /* s */:\n case 0x71 /* q */:\n case 0x74 /* t */:\n case 0x61 /* a */:\n // case 0x72/* r */:\n return true;\n default:\n return false;\n }\n}\n//# sourceMappingURL=is-path-command.js.map","/**\n * Checks if the character is an A (arc-to) path command.\n */\nexport function isArcCommand(code) {\n return (code | 0x20) === 0x61;\n}\n//# sourceMappingURL=is-arc-command.js.map","import { finalizeSegment } from './finalize-segment';\nimport { paramsCount } from './params-count';\nimport { scanFlag } from './scan-flag';\nimport { scanParam } from './scan-param';\nimport { skipSpaces } from './skip-spaces';\nimport { isPathCommand } from './is-path-command';\nimport { isDigitStart } from './is-digit-start';\nimport { isArcCommand } from './is-arc-command';\n/**\n * Scans every character in the path string to determine\n * where a segment starts and where it ends.\n */\nexport function scanSegment(path) {\n var max = path.max, pathValue = path.pathValue, index = path.index;\n var cmdCode = pathValue.charCodeAt(index);\n var reqParams = paramsCount[pathValue[index].toLowerCase()];\n path.segmentStart = index;\n if (!isPathCommand(cmdCode)) {\n path.err = \"[path-util]: Invalid path value \\\"\" + pathValue[index] + \"\\\" is not a path command\";\n return;\n }\n path.index += 1;\n skipSpaces(path);\n path.data = [];\n if (!reqParams) {\n // Z\n finalizeSegment(path);\n return;\n }\n for (;;) {\n for (var i = reqParams; i > 0; i -= 1) {\n if (isArcCommand(cmdCode) && (i === 3 || i === 4))\n scanFlag(path);\n else\n scanParam(path);\n if (path.err.length) {\n return;\n }\n path.data.push(path.param);\n skipSpaces(path);\n // after ',' param is mandatory\n if (path.index < max && pathValue.charCodeAt(path.index) === 0x2c /* , */) {\n path.index += 1;\n skipSpaces(path);\n }\n }\n if (path.index >= path.max) {\n break;\n }\n // Stop on next segment\n if (!isDigitStart(pathValue.charCodeAt(path.index))) {\n break;\n }\n }\n finalizeSegment(path);\n}\n//# sourceMappingURL=scan-segment.js.map","/**\n * The `PathParser` is used by the `parsePathString` static method\n * to generate a `pathArray`.\n */\nvar PathParser = /** @class */ (function () {\n function PathParser(pathString) {\n this.pathValue = pathString;\n // @ts-ignore\n this.segments = [];\n this.max = pathString.length;\n this.index = 0;\n this.param = 0.0;\n this.segmentStart = 0;\n this.data = [];\n this.err = '';\n }\n return PathParser;\n}());\nexport { PathParser };\n//# sourceMappingURL=path-parser.js.map","import { isPathArray } from '../util/is-path-array';\nimport { scanSegment } from './scan-segment';\nimport { skipSpaces } from './skip-spaces';\nimport { PathParser } from './path-parser';\n/**\n * Parses a path string value and returns an array\n * of segments we like to call `pathArray`.\n */\nexport function parsePathString(pathInput) {\n if (isPathArray(pathInput)) {\n return [].concat(pathInput);\n }\n var path = new PathParser(pathInput);\n skipSpaces(path);\n while (path.index < path.max && !path.err.length) {\n scanSegment(path);\n }\n return path.err ? path.err : path.segments;\n}\n//# sourceMappingURL=parse-path-string.js.map","import { isAbsoluteArray } from '../util/is-absolute-array';\nimport { parsePathString } from '../parser/parse-path-string';\nexport function path2Absolute(pathInput) {\n if (isAbsoluteArray(pathInput)) {\n return [].concat(pathInput);\n }\n var path = parsePathString(pathInput);\n // if (!path || !path.length) {\n // return [['M', 0, 0]];\n // }\n var x = 0;\n var y = 0;\n var mx = 0;\n var my = 0;\n // @ts-ignore\n return path.map(function (segment) {\n var values = segment.slice(1).map(Number);\n var pathCommand = segment[0];\n var absCommand = pathCommand.toUpperCase();\n if (pathCommand === 'M') {\n x = values[0], y = values[1];\n mx = x;\n my = y;\n return ['M', x, y];\n }\n var absoluteSegment;\n if (pathCommand !== absCommand) {\n switch (absCommand) {\n case 'A':\n absoluteSegment = [\n absCommand,\n values[0],\n values[1],\n values[2],\n values[3],\n values[4],\n values[5] + x,\n values[6] + y,\n ];\n break;\n case 'V':\n absoluteSegment = [absCommand, values[0] + y];\n break;\n case 'H':\n absoluteSegment = [absCommand, values[0] + x];\n break;\n default: {\n // use brakets for `eslint: no-case-declaration`\n // https://stackoverflow.com/a/50753272/803358\n var absValues = values.map(function (n, j) { return n + (j % 2 ? y : x); });\n // for n, l, c, s, q, t\n // @ts-ignore\n absoluteSegment = [absCommand].concat(absValues);\n }\n }\n }\n else {\n // @ts-ignore\n absoluteSegment = [absCommand].concat(values);\n }\n var segLength = absoluteSegment.length;\n switch (absCommand) {\n case 'Z':\n x = mx;\n y = my;\n break;\n case 'H':\n x = absoluteSegment[1];\n break;\n case 'V':\n y = absoluteSegment[1];\n break;\n default:\n x = absoluteSegment[segLength - 2];\n y = absoluteSegment[segLength - 1];\n if (absCommand === 'M') {\n mx = x;\n my = y;\n }\n }\n return absoluteSegment;\n });\n}\n//# sourceMappingURL=path-2-absolute.js.map","/**\n * Normalizes a single segment of a `PathArray` object.\n * eg. H/V -> L, T -> Q\n */\nexport function normalizeSegment(segment, params) {\n var pathCommand = segment[0];\n var px1 = params.x1, py1 = params.y1, px2 = params.x2, py2 = params.y2;\n var values = segment.slice(1).map(Number);\n var result = segment;\n if (!'TQ'.includes(pathCommand)) {\n // optional but good to be cautious\n params.qx = null;\n params.qy = null;\n }\n if (pathCommand === 'H') {\n result = ['L', segment[1], py1];\n }\n else if (pathCommand === 'V') {\n result = ['L', px1, segment[1]];\n }\n else if (pathCommand === 'S') {\n var x1 = px1 * 2 - px2;\n var y1 = py1 * 2 - py2;\n params.x1 = x1;\n params.y1 = y1;\n result = ['C', x1, y1].concat(values);\n }\n else if (pathCommand === 'T') {\n var qx = px1 * 2 - params.qx;\n var qy = py1 * 2 - params.qy;\n params.qx = qx;\n params.qy = qy;\n result = ['Q', qx, qy].concat(values);\n }\n else if (pathCommand === 'Q') {\n var nqx = values[0], nqy = values[1];\n params.qx = nqx;\n params.qy = nqy;\n }\n return result;\n}\n//# sourceMappingURL=normalize-segment.js.map","import { __assign } from \"tslib\";\nimport { isNormalizedArray } from '../util/is-normalized-array';\nimport { paramsParser } from '../parser/params-parser';\nimport { path2Absolute } from '../convert/path-2-absolute';\nimport { normalizeSegment } from './normalize-segment';\n/**\n * @example\n * const path = 'M0 0 H50';\n * const normalizedPath = SVGPathCommander.normalizePath(path);\n * // result => [['M', 0, 0], ['L', 50, 0]]\n */\nexport function normalizePath(pathInput) {\n if (isNormalizedArray(pathInput)) {\n return [].concat(pathInput);\n }\n var path = path2Absolute(pathInput);\n var params = __assign({}, paramsParser);\n for (var i = 0; i < path.length; i += 1) {\n // Save current path command\n path[i] = normalizeSegment(path[i], params);\n var segment = path[i];\n var seglen = segment.length;\n params.x1 = +segment[seglen - 2];\n params.y1 = +segment[seglen - 1];\n params.x2 = +segment[seglen - 4] || params.x1;\n params.y2 = +segment[seglen - 3] || params.y1;\n }\n return path;\n}\n//# sourceMappingURL=normalize-path.js.map","import { isNormalizedArray } from './is-normalized-array';\n/**\n * Iterates an array to check if it's a `PathArray`\n * with all C (cubic bezier) segments.\n *\n * @param {string | PathArray} path the `Array` to be checked\n * @returns {boolean} iteration result\n */\nexport function isCurveArray(path) {\n return isNormalizedArray(path) && path.every(function (_a) {\n var pc = _a[0];\n return 'MC'.includes(pc);\n });\n}\n//# sourceMappingURL=is-curve-array.js.map","export function rotateVector(x, y, rad) {\n var X = x * Math.cos(rad) - y * Math.sin(rad);\n var Y = x * Math.sin(rad) + y * Math.cos(rad);\n return { x: X, y: Y };\n}\n//# sourceMappingURL=rotate-vector.js.map","import { rotateVector } from '../util/rotate-vector';\n/**\n * Converts A (arc-to) segments to C (cubic-bezier-to).\n *\n * For more information of where this math came from visit:\n * http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes\n */\nexport function arcToCubic(X1, Y1, RX, RY, angle, LAF, SF, X2, Y2, recursive) {\n var x1 = X1;\n var y1 = Y1;\n var rx = RX;\n var ry = RY;\n var x2 = X2;\n var y2 = Y2;\n // for more information of where this Math came from visit:\n // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes\n var d120 = (Math.PI * 120) / 180;\n var rad = (Math.PI / 180) * (+angle || 0);\n /** @type {number[]} */\n var res = [];\n var xy;\n var f1;\n var f2;\n var cx;\n var cy;\n if (!recursive) {\n xy = rotateVector(x1, y1, -rad);\n x1 = xy.x;\n y1 = xy.y;\n xy = rotateVector(x2, y2, -rad);\n x2 = xy.x;\n y2 = xy.y;\n var x = (x1 - x2) / 2;\n var y = (y1 - y2) / 2;\n var h = (x * x) / (rx * rx) + (y * y) / (ry * ry);\n if (h > 1) {\n h = Math.sqrt(h);\n rx *= h;\n ry *= h;\n }\n var rx2 = rx * rx;\n var ry2 = ry * ry;\n var k = (LAF === SF ? -1 : 1) *\n Math.sqrt(Math.abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x)));\n cx = (k * rx * y) / ry + (x1 + x2) / 2;\n cy = (k * -ry * x) / rx + (y1 + y2) / 2;\n // eslint-disable-next-line no-bitwise -- Impossible to satisfy no-bitwise\n f1 = Math.asin(((((y1 - cy) / ry) * Math.pow(10, 9)) >> 0) / Math.pow(10, 9));\n // eslint-disable-next-line no-bitwise -- Impossible to satisfy no-bitwise\n f2 = Math.asin(((((y2 - cy) / ry) * Math.pow(10, 9)) >> 0) / Math.pow(10, 9));\n f1 = x1 < cx ? Math.PI - f1 : f1;\n f2 = x2 < cx ? Math.PI - f2 : f2;\n if (f1 < 0)\n f1 = Math.PI * 2 + f1;\n if (f2 < 0)\n f2 = Math.PI * 2 + f2;\n if (SF && f1 > f2) {\n f1 -= Math.PI * 2;\n }\n if (!SF && f2 > f1) {\n f2 -= Math.PI * 2;\n }\n }\n else {\n f1 = recursive[0], f2 = recursive[1], cx = recursive[2], cy = recursive[3];\n }\n var df = f2 - f1;\n if (Math.abs(df) > d120) {\n var f2old = f2;\n var x2old = x2;\n var y2old = y2;\n f2 = f1 + d120 * (SF && f2 > f1 ? 1 : -1);\n x2 = cx + rx * Math.cos(f2);\n y2 = cy + ry * Math.sin(f2);\n res = arcToCubic(x2, y2, rx, ry, angle, 0, SF, x2old, y2old, [f2, f2old, cx, cy]);\n }\n df = f2 - f1;\n var c1 = Math.cos(f1);\n var s1 = Math.sin(f1);\n var c2 = Math.cos(f2);\n var s2 = Math.sin(f2);\n var t = Math.tan(df / 4);\n var hx = (4 / 3) * rx * t;\n var hy = (4 / 3) * ry * t;\n var m1 = [x1, y1];\n var m2 = [x1 + hx * s1, y1 - hy * c1];\n var m3 = [x2 + hx * s2, y2 - hy * c2];\n var m4 = [x2, y2];\n m2[0] = 2 * m1[0] - m2[0];\n m2[1] = 2 * m1[1] - m2[1];\n if (recursive) {\n return m2.concat(m3, m4, res);\n // return [...m2, ...m3, ...m4, ...res];\n }\n res = m2.concat(m3, m4, res);\n // res = [...m2, ...m3, ...m4, ...res];\n var newres = [];\n for (var i = 0, ii = res.length; i < ii; i += 1) {\n newres[i] = i % 2 ? rotateVector(res[i - 1], res[i], rad).y : rotateVector(res[i], res[i + 1], rad).x;\n }\n return newres;\n}\n// const TAU = Math.PI * 2;\n// const mapToEllipse = (\n// { x, y }: { x: number; y: number },\n// rx: number,\n// ry: number,\n// cosphi: number,\n// sinphi: number,\n// centerx: number,\n// centery: number,\n// ) => {\n// x *= rx;\n// y *= ry;\n// const xp = cosphi * x - sinphi * y;\n// const yp = sinphi * x + cosphi * y;\n// return {\n// x: xp + centerx,\n// y: yp + centery,\n// };\n// };\n// const approxUnitArc = (ang1: number, ang2: number) => {\n// // If 90 degree circular arc, use a constant\n// // as derived from http://spencermortensen.com/articles/bezier-circle\n// const a =\n// ang2 === 1.5707963267948966\n// ? 0.551915024494\n// : ang2 === -1.5707963267948966\n// ? -0.551915024494\n// : (4 / 3) * Math.tan(ang2 / 4);\n// const x1 = Math.cos(ang1);\n// const y1 = Math.sin(ang1);\n// const x2 = Math.cos(ang1 + ang2);\n// const y2 = Math.sin(ang1 + ang2);\n// return [\n// {\n// x: x1 - y1 * a,\n// y: y1 + x1 * a,\n// },\n// {\n// x: x2 + y2 * a,\n// y: y2 - x2 * a,\n// },\n// {\n// x: x2,\n// y: y2,\n// },\n// ];\n// };\n// const vectorAngle = (ux: number, uy: number, vx: number, vy: number) => {\n// const sign = ux * vy - uy * vx < 0 ? -1 : 1;\n// let dot = ux * vx + uy * vy;\n// if (dot > 1) {\n// dot = 1;\n// }\n// if (dot < -1) {\n// dot = -1;\n// }\n// return sign * Math.acos(dot);\n// };\n// const getArcCenter = (\n// px: any,\n// py: any,\n// cx: any,\n// cy: any,\n// rx: number,\n// ry: number,\n// largeArcFlag: number,\n// sweepFlag: number,\n// sinphi: number,\n// cosphi: number,\n// pxp: number,\n// pyp: number,\n// ) => {\n// const rxsq = Math.pow(rx, 2);\n// const rysq = Math.pow(ry, 2);\n// const pxpsq = Math.pow(pxp, 2);\n// const pypsq = Math.pow(pyp, 2);\n// let radicant = rxsq * rysq - rxsq * pypsq - rysq * pxpsq;\n// if (radicant < 0) {\n// radicant = 0;\n// }\n// radicant /= rxsq * pypsq + rysq * pxpsq;\n// radicant = Math.sqrt(radicant) * (largeArcFlag === sweepFlag ? -1 : 1);\n// const centerxp = ((radicant * rx) / ry) * pyp;\n// const centeryp = ((radicant * -ry) / rx) * pxp;\n// const centerx = cosphi * centerxp - sinphi * centeryp + (px + cx) / 2;\n// const centery = sinphi * centerxp + cosphi * centeryp + (py + cy) / 2;\n// const vx1 = (pxp - centerxp) / rx;\n// const vy1 = (pyp - centeryp) / ry;\n// const vx2 = (-pxp - centerxp) / rx;\n// const vy2 = (-pyp - centeryp) / ry;\n// const ang1 = vectorAngle(1, 0, vx1, vy1);\n// let ang2 = vectorAngle(vx1, vy1, vx2, vy2);\n// if (sweepFlag === 0 && ang2 > 0) {\n// ang2 -= TAU;\n// }\n// if (sweepFlag === 1 && ang2 < 0) {\n// ang2 += TAU;\n// }\n// return [centerx, centery, ang1, ang2];\n// };\n// const arcToBezier = ({ px, py, cx, cy, rx, ry, xAxisRotation = 0, largeArcFlag = 0, sweepFlag = 0 }) => {\n// const curves = [];\n// if (rx === 0 || ry === 0) {\n// return [{ x1: 0, y1: 0, x2: 0, y2: 0, x: cx, y: cy }];\n// }\n// const sinphi = Math.sin((xAxisRotation * TAU) / 360);\n// const cosphi = Math.cos((xAxisRotation * TAU) / 360);\n// const pxp = (cosphi * (px - cx)) / 2 + (sinphi * (py - cy)) / 2;\n// const pyp = (-sinphi * (px - cx)) / 2 + (cosphi * (py - cy)) / 2;\n// if (pxp === 0 && pyp === 0) {\n// return [{ x1: 0, y1: 0, x2: 0, y2: 0, x: cx, y: cy }];\n// }\n// rx = Math.abs(rx);\n// ry = Math.abs(ry);\n// const lambda = Math.pow(pxp, 2) / Math.pow(rx, 2) + Math.pow(pyp, 2) / Math.pow(ry, 2);\n// if (lambda > 1) {\n// rx *= Math.sqrt(lambda);\n// ry *= Math.sqrt(lambda);\n// }\n// let [centerx, centery, ang1, ang2] = getArcCenter(\n// px,\n// py,\n// cx,\n// cy,\n// rx,\n// ry,\n// largeArcFlag,\n// sweepFlag,\n// sinphi,\n// cosphi,\n// pxp,\n// pyp,\n// );\n// // If 'ang2' == 90.0000000001, then `ratio` will evaluate to\n// // 1.0000000001. This causes `segments` to be greater than one, which is an\n// // unecessary split, and adds extra points to the bezier curve. To alleviate\n// // this issue, we round to 1.0 when the ratio is close to 1.0.\n// let ratio = Math.abs(ang2) / (TAU / 4);\n// if (Math.abs(1.0 - ratio) < 0.0000001) {\n// ratio = 1.0;\n// }\n// const segments = Math.max(Math.ceil(ratio), 1);\n// ang2 /= segments;\n// for (let i = 0; i < segments; i++) {\n// curves.push(approxUnitArc(ang1, ang2));\n// ang1 += ang2;\n// }\n// return curves.map((curve) => {\n// const { x: x1, y: y1 } = mapToEllipse(curve[0], rx, ry, cosphi, sinphi, centerx, centery);\n// const { x: x2, y: y2 } = mapToEllipse(curve[1], rx, ry, cosphi, sinphi, centerx, centery);\n// const { x, y } = mapToEllipse(curve[2], rx, ry, cosphi, sinphi, centerx, centery);\n// return { x1, y1, x2, y2, x, y };\n// });\n// };\n// export function arcToCubic(\n// x1: number,\n// y1: number,\n// rx: number,\n// ry: number,\n// angle: number,\n// LAF: number,\n// SF: number,\n// x2: number,\n// y2: number,\n// ) {\n// const curves = arcToBezier({\n// px: x1,\n// py: y1,\n// cx: x2,\n// cy: y2,\n// rx,\n// ry,\n// xAxisRotation: angle,\n// largeArcFlag: LAF,\n// sweepFlag: SF,\n// });\n// return curves.reduce((prev, cur) => {\n// const { x1, y1, x2, y2, x, y } = cur;\n// prev.push(x1, y1, x2, y2, x, y);\n// return prev;\n// }, [] as number[]);\n// }\n//# sourceMappingURL=arc-2-cubic.js.map","export function quadToCubic(x1, y1, qx, qy, x2, y2) {\n var r13 = 1 / 3;\n var r23 = 2 / 3;\n return [\n r13 * x1 + r23 * qx,\n r13 * y1 + r23 * qy,\n r13 * x2 + r23 * qx,\n r13 * y2 + r23 * qy,\n x2,\n y2, // x,y\n ];\n}\n//# sourceMappingURL=quad-2-cubic.js.map","export function midPoint(a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var bx = b[0];\n var by = b[1];\n return [ax + (bx - ax) * t, ay + (by - ay) * t];\n}\n//# sourceMappingURL=mid-point.js.map","import { __spreadArray } from \"tslib\";\nimport { midPoint } from '../util/mid-point';\nexport var lineToCubic = function (x1, y1, x2, y2) {\n var t = 0.5;\n var mid = midPoint([x1, y1], [x2, y2], t);\n return __spreadArray(__spreadArray([], mid, true), [x2, y2, x2, y2], false);\n};\n//# sourceMappingURL=line-2-cubic.js.map","import { arcToCubic } from './arc-2-cubic';\nimport { quadToCubic } from './quad-2-cubic';\nimport { lineToCubic } from './line-2-cubic';\nexport function segmentToCubic(segment, params) {\n var pathCommand = segment[0];\n var values = segment.slice(1).map(Number);\n var x = values[0], y = values[1];\n var args;\n var px1 = params.x1, py1 = params.y1, px = params.x, py = params.y;\n if (!'TQ'.includes(pathCommand)) {\n params.qx = null;\n params.qy = null;\n }\n switch (pathCommand) {\n case 'M':\n params.x = x;\n params.y = y;\n return segment;\n case 'A':\n args = [px1, py1].concat(values);\n // @ts-ignore\n return ['C'].concat(arcToCubic(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]));\n case 'Q':\n params.qx = x;\n params.qy = y;\n args = [px1, py1].concat(values);\n // @ts-ignore\n return ['C'].concat(quadToCubic(args[0], args[1], args[2], args[3], args[4], args[5]));\n case 'L':\n // @ts-ignore\n return ['C'].concat(lineToCubic(px1, py1, x, y));\n case 'Z':\n // prevent NaN from divide 0\n if (px1 === px && py1 === py) {\n return ['C', px1, py1, px, py, px, py];\n }\n // @ts-ignore\n return ['C'].concat(lineToCubic(px1, py1, px, py));\n default:\n }\n return segment;\n}\n//# sourceMappingURL=segment-2-cubic.js.map","import { __assign } from \"tslib\";\nimport { paramsParser } from '../parser/params-parser';\nimport { fixArc } from '../process/fix-arc';\nimport { normalizePath } from '../process/normalize-path';\nimport { isCurveArray } from '../util/is-curve-array';\nimport { segmentToCubic } from '../process/segment-2-cubic';\n// import { fixPath } from '../process/fix-path';\nexport function path2Curve(pathInput, needZCommandIndexes) {\n if (needZCommandIndexes === void 0) { needZCommandIndexes = false; }\n if (isCurveArray(pathInput)) {\n var cloned = [].concat(pathInput);\n if (needZCommandIndexes) {\n return [cloned, []];\n }\n else {\n return cloned;\n }\n }\n // fixPath will remove 'Z' command\n // const path = fixPath(normalizePath(pathInput));\n var path = normalizePath(pathInput);\n var params = __assign({}, paramsParser);\n var allPathCommands = [];\n var pathCommand = '';\n var ii = path.length;\n var segment;\n var seglen;\n var zCommandIndexes = [];\n for (var i = 0; i < ii; i += 1) {\n if (path[i])\n pathCommand = path[i][0];\n allPathCommands[i] = pathCommand;\n var curveSegment = segmentToCubic(path[i], params);\n path[i] = curveSegment;\n fixArc(path, allPathCommands, i);\n ii = path.length; // solves curveArrays ending in Z\n // keep Z command account for lineJoin\n // @see https://github.com/antvis/util/issues/68\n if (pathCommand === 'Z') {\n zCommandIndexes.push(i);\n }\n segment = path[i];\n seglen = segment.length;\n params.x1 = +segment[seglen - 2];\n params.y1 = +segment[seglen - 1];\n params.x2 = +segment[seglen - 4] || params.x1;\n params.y2 = +segment[seglen - 3] || params.y1;\n }\n // validate\n if (needZCommandIndexes) {\n return [path, zCommandIndexes];\n }\n else {\n return path;\n }\n}\n//# sourceMappingURL=path-2-curve.js.map","export function clonePath(path) {\n return path.map(function (x) { return (Array.isArray(x) ? [].concat(x) : x); });\n}\n//# sourceMappingURL=clone-path.js.map","// reverse CURVE based pathArray segments only\nexport function reverseCurve(pathArray) {\n var rotatedCurve = pathArray\n .slice(1)\n .map(function (x, i, curveOnly) {\n // @ts-ignore\n return !i ? pathArray[0].slice(1).concat(x.slice(1)) : curveOnly[i - 1].slice(-2).concat(x.slice(1));\n })\n // @ts-ignore\n .map(function (x) { return x.map(function (y, i) { return x[x.length - i - 2 * (1 - (i % 2))]; }); })\n .reverse();\n return [['M'].concat(rotatedCurve[0].slice(0, 2))].concat(rotatedCurve.map(function (x) { return ['C'].concat(x.slice(2)); }));\n}\n//# sourceMappingURL=reverse-curve.js.map","export function distanceSquareRoot(a, b) {\n return Math.sqrt((a[0] - b[0]) * (a[0] - b[0]) + (a[1] - b[1]) * (a[1] - b[1]));\n}\n//# sourceMappingURL=distance-square-root.js.map","import { midPoint } from './mid-point';\nimport { distanceSquareRoot } from './distance-square-root';\n/**\n * Returns a {x,y} point at a given length, the total length and\n * the minimum and maximum {x,y} coordinates of a line (L,V,H,Z) segment.\n */\nexport function segmentLineFactory(x1, y1, x2, y2, distance) {\n var length = distanceSquareRoot([x1, y1], [x2, y2]);\n var point = { x: 0, y: 0 };\n if (typeof distance === 'number') {\n if (distance <= 0) {\n point = { x: x1, y: y1 };\n }\n else if (distance >= length) {\n point = { x: x2, y: y2 };\n }\n else {\n var _a = midPoint([x1, y1], [x2, y2], distance / length), x = _a[0], y = _a[1];\n point = { x: x, y: y };\n }\n }\n return {\n length: length,\n point: point,\n min: {\n x: Math.min(x1, x2),\n y: Math.min(y1, y2),\n },\n max: {\n x: Math.max(x1, x2),\n y: Math.max(y1, y2),\n },\n };\n}\n//# sourceMappingURL=segment-line-factory.js.map","import { segmentLineFactory } from './segment-line-factory';\nimport { distanceSquareRoot } from './distance-square-root';\nfunction angleBetween(v0, v1) {\n var v0x = v0.x, v0y = v0.y;\n var v1x = v1.x, v1y = v1.y;\n var p = v0x * v1x + v0y * v1y;\n var n = Math.sqrt((Math.pow(v0x, 2) + Math.pow(v0y, 2)) * (Math.pow(v1x, 2) + Math.pow(v1y, 2)));\n var sign = v0x * v1y - v0y * v1x < 0 ? -1 : 1;\n var angle = sign * Math.acos(p / n);\n return angle;\n}\n/**\n * Returns a {x,y} point at a given length, the total length and\n * the minimum and maximum {x,y} coordinates of a C (cubic-bezier) segment.\n * @see https://github.com/MadLittleMods/svg-curve-lib/blob/master/src/js/svg-curve-lib.js\n */\nfunction getPointAtArcSegmentLength(x1, y1, RX, RY, angle, LAF, SF, x, y, t) {\n var abs = Math.abs, sin = Math.sin, cos = Math.cos, sqrt = Math.sqrt, PI = Math.PI;\n var rx = abs(RX);\n var ry = abs(RY);\n var xRot = ((angle % 360) + 360) % 360;\n var xRotRad = xRot * (PI / 180);\n if (x1 === x && y1 === y) {\n return { x: x1, y: y1 };\n }\n if (rx === 0 || ry === 0) {\n return segmentLineFactory(x1, y1, x, y, t).point;\n }\n var dx = (x1 - x) / 2;\n var dy = (y1 - y) / 2;\n var transformedPoint = {\n x: cos(xRotRad) * dx + sin(xRotRad) * dy,\n y: -sin(xRotRad) * dx + cos(xRotRad) * dy,\n };\n var radiiCheck = Math.pow(transformedPoint.x, 2) / Math.pow(rx, 2) + Math.pow(transformedPoint.y, 2) / Math.pow(ry, 2);\n if (radiiCheck > 1) {\n rx *= sqrt(radiiCheck);\n ry *= sqrt(radiiCheck);\n }\n var cSquareNumerator = Math.pow(rx, 2) * Math.pow(ry, 2) - Math.pow(rx, 2) * Math.pow(transformedPoint.y, 2) - Math.pow(ry, 2) * Math.pow(transformedPoint.x, 2);\n var cSquareRootDenom = Math.pow(rx, 2) * Math.pow(transformedPoint.y, 2) + Math.pow(ry, 2) * Math.pow(transformedPoint.x, 2);\n var cRadicand = cSquareNumerator / cSquareRootDenom;\n cRadicand = cRadicand < 0 ? 0 : cRadicand;\n var cCoef = (LAF !== SF ? 1 : -1) * sqrt(cRadicand);\n var transformedCenter = {\n x: cCoef * ((rx * transformedPoint.y) / ry),\n y: cCoef * (-(ry * transformedPoint.x) / rx),\n };\n var center = {\n x: cos(xRotRad) * transformedCenter.x - sin(xRotRad) * transformedCenter.y + (x1 + x) / 2,\n y: sin(xRotRad) * transformedCenter.x + cos(xRotRad) * transformedCenter.y + (y1 + y) / 2,\n };\n var startVector = {\n x: (transformedPoint.x - transformedCenter.x) / rx,\n y: (transformedPoint.y - transformedCenter.y) / ry,\n };\n var startAngle = angleBetween({ x: 1, y: 0 }, startVector);\n var endVector = {\n x: (-transformedPoint.x - transformedCenter.x) / rx,\n y: (-transformedPoint.y - transformedCenter.y) / ry,\n };\n var sweepAngle = angleBetween(startVector, endVector);\n if (!SF && sweepAngle > 0) {\n sweepAngle -= 2 * PI;\n }\n else if (SF && sweepAngle < 0) {\n sweepAngle += 2 * PI;\n }\n sweepAngle %= 2 * PI;\n var alpha = startAngle + sweepAngle * t;\n var ellipseComponentX = rx * cos(alpha);\n var ellipseComponentY = ry * sin(alpha);\n var point = {\n x: cos(xRotRad) * ellipseComponentX - sin(xRotRad) * ellipseComponentY + center.x,\n y: sin(xRotRad) * ellipseComponentX + cos(xRotRad) * ellipseComponentY + center.y,\n };\n // to be used later\n // point.ellipticalArcStartAngle = startAngle;\n // point.ellipticalArcEndAngle = startAngle + sweepAngle;\n // point.ellipticalArcAngle = alpha;\n // point.ellipticalArcCenter = center;\n // point.resultantRx = rx;\n // point.resultantRy = ry;\n return point;\n}\n/**\n * Returns a {x,y} point at a given length, the total length and\n * the shape minimum and maximum {x,y} coordinates of an A (arc-to) segment.\n *\n * For better performance, it can skip calculate bbox or length in some scenario.\n */\nexport function segmentArcFactory(X1, Y1, RX, RY, angle, LAF, SF, X2, Y2, distance, options) {\n var _a;\n var _b = options.bbox, bbox = _b === void 0 ? true : _b, _c = options.length, length = _c === void 0 ? true : _c, _d = options.sampleSize, sampleSize = _d === void 0 ? 30 : _d;\n var distanceIsNumber = typeof distance === 'number';\n var x = X1;\n var y = Y1;\n var LENGTH = 0;\n var prev = [x, y, LENGTH];\n var cur = [x, y];\n var t = 0;\n var POINT = { x: 0, y: 0 };\n var POINTS = [{ x: x, y: y }];\n if (distanceIsNumber && distance <= 0) {\n POINT = { x: x, y: y };\n }\n // bad perf when size > 100\n for (var j = 0; j <= sampleSize; j += 1) {\n t = j / sampleSize;\n (_a = getPointAtArcSegmentLength(X1, Y1, RX, RY, angle, LAF, SF, X2, Y2, t), x = _a.x, y = _a.y);\n if (bbox) {\n POINTS.push({ x: x, y: y });\n }\n if (length) {\n LENGTH += distanceSquareRoot(cur, [x, y]);\n }\n cur = [x, y];\n if (distanceIsNumber && LENGTH >= distance && distance > prev[2]) {\n var dv = (LENGTH - distance) / (LENGTH - prev[2]);\n POINT = {\n x: cur[0] * (1 - dv) + prev[0] * dv,\n y: cur[1] * (1 - dv) + prev[1] * dv,\n };\n }\n prev = [x, y, LENGTH];\n }\n if (distanceIsNumber && distance >= LENGTH) {\n POINT = { x: X2, y: Y2 };\n }\n return {\n length: LENGTH,\n point: POINT,\n min: {\n x: Math.min.apply(null, POINTS.map(function (n) { return n.x; })),\n y: Math.min.apply(null, POINTS.map(function (n) { return n.y; })),\n },\n max: {\n x: Math.max.apply(null, POINTS.map(function (n) { return n.x; })),\n y: Math.max.apply(null, POINTS.map(function (n) { return n.y; })),\n },\n };\n}\n//# sourceMappingURL=segment-arc-factory.js.map","import { distanceSquareRoot } from './distance-square-root';\n/**\n * Returns a {x,y} point at a given length, the total length and\n * the minimum and maximum {x,y} coordinates of a C (cubic-bezier) segment.\n */\nfunction getPointAtCubicSegmentLength(x1, y1, c1x, c1y, c2x, c2y, x2, y2, t) {\n var t1 = 1 - t;\n return {\n x: Math.pow(t1, 3) * x1 + 3 * Math.pow(t1, 2) * t * c1x + 3 * t1 * Math.pow(t, 2) * c2x + Math.pow(t, 3) * x2,\n y: Math.pow(t1, 3) * y1 + 3 * Math.pow(t1, 2) * t * c1y + 3 * t1 * Math.pow(t, 2) * c2y + Math.pow(t, 3) * y2,\n };\n}\n/**\n * Returns the length of a C (cubic-bezier) segment\n * or an {x,y} point at a given length.\n */\nexport function segmentCubicFactory(x1, y1, c1x, c1y, c2x, c2y, x2, y2, distance, options) {\n var _a;\n var _b = options.bbox, bbox = _b === void 0 ? true : _b, _c = options.length, length = _c === void 0 ? true : _c, _d = options.sampleSize, sampleSize = _d === void 0 ? 10 : _d;\n var distanceIsNumber = typeof distance === 'number';\n var x = x1;\n var y = y1;\n var LENGTH = 0;\n var prev = [x, y, LENGTH];\n var cur = [x, y];\n var t = 0;\n var POINT = { x: 0, y: 0 };\n var POINTS = [{ x: x, y: y }];\n if (distanceIsNumber && distance <= 0) {\n POINT = { x: x, y: y };\n }\n // bad perf when size = 300\n for (var j = 0; j <= sampleSize; j += 1) {\n t = j / sampleSize;\n (_a = getPointAtCubicSegmentLength(x1, y1, c1x, c1y, c2x, c2y, x2, y2, t), x = _a.x, y = _a.y);\n if (bbox) {\n POINTS.push({ x: x, y: y });\n }\n if (length) {\n LENGTH += distanceSquareRoot(cur, [x, y]);\n }\n cur = [x, y];\n if (distanceIsNumber && LENGTH >= distance && distance > prev[2]) {\n var dv = (LENGTH - distance) / (LENGTH - prev[2]);\n POINT = {\n x: cur[0] * (1 - dv) + prev[0] * dv,\n y: cur[1] * (1 - dv) + prev[1] * dv,\n };\n }\n prev = [x, y, LENGTH];\n }\n if (distanceIsNumber && distance >= LENGTH) {\n POINT = { x: x2, y: y2 };\n }\n return {\n length: LENGTH,\n point: POINT,\n min: {\n x: Math.min.apply(null, POINTS.map(function (n) { return n.x; })),\n y: Math.min.apply(null, POINTS.map(function (n) { return n.y; })),\n },\n max: {\n x: Math.max.apply(null, POINTS.map(function (n) { return n.x; })),\n y: Math.max.apply(null, POINTS.map(function (n) { return n.y; })),\n },\n };\n}\n//# sourceMappingURL=segment-cubic-factory.js.map","import { distanceSquareRoot } from './distance-square-root';\n/**\n * Returns the {x,y} coordinates of a point at a\n * given length of a quadratic-bezier segment.\n *\n * @see https://github.com/substack/point-at-length\n */\nfunction getPointAtQuadSegmentLength(x1, y1, cx, cy, x2, y2, t) {\n var t1 = 1 - t;\n return {\n x: Math.pow(t1, 2) * x1 + 2 * t1 * t * cx + Math.pow(t, 2) * x2,\n y: Math.pow(t1, 2) * y1 + 2 * t1 * t * cy + Math.pow(t, 2) * y2,\n };\n}\n/**\n * Returns a {x,y} point at a given length, the total length and\n * the minimum and maximum {x,y} coordinates of a Q (quadratic-bezier) segment.\n */\nexport function segmentQuadFactory(x1, y1, qx, qy, x2, y2, distance, options) {\n var _a;\n var _b = options.bbox, bbox = _b === void 0 ? true : _b, _c = options.length, length = _c === void 0 ? true : _c, _d = options.sampleSize, sampleSize = _d === void 0 ? 10 : _d;\n var distanceIsNumber = typeof distance === 'number';\n var x = x1;\n var y = y1;\n var LENGTH = 0;\n var prev = [x, y, LENGTH];\n var cur = [x, y];\n var t = 0;\n var POINT = { x: 0, y: 0 };\n var POINTS = [{ x: x, y: y }];\n if (distanceIsNumber && distance <= 0) {\n POINT = { x: x, y: y };\n }\n for (var j = 0; j <= sampleSize; j += 1) {\n t = j / sampleSize;\n (_a = getPointAtQuadSegmentLength(x1, y1, qx, qy, x2, y2, t), x = _a.x, y = _a.y);\n if (bbox) {\n POINTS.push({ x: x, y: y });\n }\n if (length) {\n LENGTH += distanceSquareRoot(cur, [x, y]);\n }\n cur = [x, y];\n if (distanceIsNumber && LENGTH >= distance && distance > prev[2]) {\n var dv = (LENGTH - distance) / (LENGTH - prev[2]);\n POINT = {\n x: cur[0] * (1 - dv) + prev[0] * dv,\n y: cur[1] * (1 - dv) + prev[1] * dv,\n };\n }\n prev = [x, y, LENGTH];\n }\n /* istanbul ignore else */\n if (distanceIsNumber && distance >= LENGTH) {\n POINT = { x: x2, y: y2 };\n }\n return {\n length: LENGTH,\n point: POINT,\n min: {\n x: Math.min.apply(null, POINTS.map(function (n) { return n.x; })),\n y: Math.min.apply(null, POINTS.map(function (n) { return n.y; })),\n },\n max: {\n x: Math.max.apply(null, POINTS.map(function (n) { return n.x; })),\n y: Math.max.apply(null, POINTS.map(function (n) { return n.y; })),\n },\n };\n}\n//# sourceMappingURL=segment-quad-factory.js.map","import { normalizePath } from '../process/normalize-path';\nimport { segmentLineFactory } from './segment-line-factory';\nimport { segmentArcFactory } from './segment-arc-factory';\nimport { segmentCubicFactory } from './segment-cubic-factory';\nimport { segmentQuadFactory } from './segment-quad-factory';\n/**\n * Returns a {x,y} point at a given length\n * of a shape, the shape total length and\n * the shape minimum and maximum {x,y} coordinates.\n */\nexport function pathLengthFactory(pathInput, distance, options) {\n var _a, _b, _c, _d, _e, _f;\n var path = normalizePath(pathInput);\n var distanceIsNumber = typeof distance === 'number';\n var isM;\n var data = [];\n var pathCommand;\n var x = 0;\n var y = 0;\n var mx = 0;\n var my = 0;\n var seg;\n var MIN = [];\n var MAX = [];\n var length = 0;\n var min = { x: 0, y: 0 };\n var max = min;\n var point = min;\n var POINT = min;\n var LENGTH = 0;\n for (var i = 0, ll = path.length; i < ll; i += 1) {\n seg = path[i];\n pathCommand = seg[0];\n isM = pathCommand === 'M';\n data = !isM ? [x, y].concat(seg.slice(1)) : data;\n // this segment is always ZERO\n /* istanbul ignore else */\n if (isM) {\n // remember mx, my for Z\n mx = seg[1], my = seg[2];\n min = { x: mx, y: my };\n max = min;\n length = 0;\n if (distanceIsNumber && distance < 0.001) {\n POINT = min;\n }\n }\n else if (pathCommand === 'L') {\n (_a = segmentLineFactory(data[0], data[1], data[2], data[3], (distance || 0) - LENGTH), length = _a.length, min = _a.min, max = _a.max, point = _a.point);\n }\n else if (pathCommand === 'A') {\n (_b = segmentArcFactory(data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7], data[8], (distance || 0) - LENGTH, options || {}), length = _b.length, min = _b.min, max = _b.max, point = _b.point);\n }\n else if (pathCommand === 'C') {\n (_c = segmentCubicFactory(data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7], (distance || 0) - LENGTH, options || {}), length = _c.length, min = _c.min, max = _c.max, point = _c.point);\n }\n else if (pathCommand === 'Q') {\n (_d = segmentQuadFactory(data[0], data[1], data[2], data[3], data[4], data[5], (distance || 0) - LENGTH, options || {}), length = _d.length, min = _d.min, max = _d.max, point = _d.point);\n }\n else if (pathCommand === 'Z') {\n data = [x, y, mx, my];\n (_e = segmentLineFactory(data[0], data[1], data[2], data[3], (distance || 0) - LENGTH), length = _e.length, min = _e.min, max = _e.max, point = _e.point);\n }\n if (distanceIsNumber && LENGTH < distance && LENGTH + length >= distance) {\n POINT = point;\n }\n MAX.push(max);\n MIN.push(min);\n LENGTH += length;\n _f = pathCommand !== 'Z' ? seg.slice(-2) : [mx, my], x = _f[0], y = _f[1];\n }\n // native `getPointAtLength` behavior when the given distance\n // is higher than total length\n if (distanceIsNumber && distance >= LENGTH) {\n POINT = { x: x, y: y };\n }\n return {\n length: LENGTH,\n point: POINT,\n min: {\n x: Math.min.apply(null, MIN.map(function (n) { return n.x; })),\n y: Math.min.apply(null, MIN.map(function (n) { return n.y; })),\n },\n max: {\n x: Math.max.apply(null, MAX.map(function (n) { return n.x; })),\n y: Math.max.apply(null, MAX.map(function (n) { return n.y; })),\n },\n };\n}\n//# sourceMappingURL=path-length-factory.js.map","import { __assign } from \"tslib\";\nimport { pathLengthFactory } from './path-length-factory';\n/**\n * Returns the shape total length, or the equivalent to `shape.getTotalLength()`.\n *\n * The `normalizePath` version is lighter, faster, more efficient and more accurate\n * with paths that are not `curveArray`.\n */\nexport function getTotalLength(pathInput, options) {\n return pathLengthFactory(pathInput, undefined, __assign(__assign({}, options), { bbox: false, length: true })).length;\n}\n//# sourceMappingURL=get-total-length.js.map","import { distanceSquareRoot } from './distance-square-root';\nfunction getRotations(a) {\n var segCount = a.length;\n var pointCount = segCount - 1;\n return a.map(function (f, idx) {\n return a.map(function (p, i) {\n var oldSegIdx = idx + i;\n var seg;\n if (i === 0 || (a[oldSegIdx] && a[oldSegIdx][0] === 'M')) {\n seg = a[oldSegIdx];\n return ['M'].concat(seg.slice(-2));\n }\n if (oldSegIdx >= segCount)\n oldSegIdx -= pointCount;\n return a[oldSegIdx];\n });\n });\n}\nexport function getRotatedCurve(a, b) {\n var segCount = a.length - 1;\n var lineLengths = [];\n var computedIndex = 0;\n var sumLensSqrd = 0;\n var rotations = getRotations(a);\n rotations.forEach(function (r, i) {\n a.slice(1).forEach(function (s, j) {\n // @ts-ignore\n sumLensSqrd += distanceSquareRoot(a[(i + j) % segCount].slice(-2), b[j % segCount].slice(-2));\n });\n lineLengths[i] = sumLensSqrd;\n sumLensSqrd = 0;\n });\n computedIndex = lineLengths.indexOf(Math.min.apply(null, lineLengths));\n return rotations[computedIndex];\n}\n//# sourceMappingURL=get-rotated-curve.js.map","import { path2Curve } from '../convert/path-2-curve';\n/**\n * Returns the area of a single cubic-bezier segment.\n *\n * http://objectmix.com/graphics/133553-area-closed-bezier-curve.html\n */\nfunction getCubicSegArea(x1, y1, c1x, c1y, c2x, c2y, x2, y2) {\n // https://stackoverflow.com/a/15845996\n return ((3 *\n ((y2 - y1) * (c1x + c2x) -\n (x2 - x1) * (c1y + c2y) +\n c1y * (x1 - c2x) -\n c1x * (y1 - c2y) +\n y2 * (c2x + x1 / 3) -\n x2 * (c2y + y1 / 3))) /\n 20);\n}\n/**\n * Returns the area of a shape.\n * @author Jürg Lehni & Jonathan Puckey\n *\n * @see https://github.com/paperjs/paper.js/blob/develop/src/path/Path.js\n */\nexport function getPathArea(path) {\n var x = 0;\n var y = 0;\n var len = 0;\n return path2Curve(path)\n .map(function (seg) {\n var _a;\n switch (seg[0]) {\n case 'M':\n x = seg[1], y = seg[2];\n return 0;\n default:\n // @ts-ignore\n var _b = seg.slice(1), c1x = _b[0], c1y = _b[1], c2x = _b[2], c2y = _b[3], x2 = _b[4], y2 = _b[5];\n len = getCubicSegArea(x, y, c1x, c1y, c2x, c2y, x2, y2);\n _a = seg.slice(-2), x = _a[0], y = _a[1];\n return len;\n }\n })\n .reduce(function (a, b) { return a + b; }, 0);\n}\n// export function getPathArea(pathArray: AbsoluteArray) {\n// let x = 0;\n// let y = 0;\n// let mx = 0;\n// let my = 0;\n// let len = 0;\n// return pathArray\n// .map((seg) => {\n// switch (seg[0]) {\n// case 'M':\n// case 'Z':\n// mx = seg[0] === 'M' ? seg[1] : mx;\n// my = seg[0] === 'M' ? seg[2] : my;\n// x = mx;\n// y = my;\n// return 0;\n// default:\n// // @ts-ignore\n// len = getCubicSegArea.apply(0, [x, y].concat(seg.slice(1)));\n// [x, y] = seg.slice(-2) as [number, number];\n// return len;\n// }\n// })\n// .reduce((a, b) => a + b, 0);\n// }\n//# sourceMappingURL=get-path-area.js.map","import { getPathArea } from './get-path-area';\nexport function getDrawDirection(pathArray) {\n return getPathArea(pathArray) >= 0;\n}\n//# sourceMappingURL=get-draw-direction.js.map","import { __assign } from \"tslib\";\nimport { pathLengthFactory } from './path-length-factory';\n/**\n * Returns [x,y] coordinates of a point at a given length of a shape.\n */\nexport function getPointAtLength(pathInput, distance, options) {\n return pathLengthFactory(pathInput, distance, __assign(__assign({}, options), { bbox: false, length: true })).point;\n}\n//# sourceMappingURL=get-point-at-length.js.map","import { midPoint } from './mid-point';\nimport { segmentCubicFactory } from './segment-cubic-factory';\nfunction splitCubic(pts, t) {\n if (t === void 0) { t = 0.5; }\n var p0 = pts.slice(0, 2);\n var p1 = pts.slice(2, 4);\n var p2 = pts.slice(4, 6);\n var p3 = pts.slice(6, 8);\n var p4 = midPoint(p0, p1, t);\n var p5 = midPoint(p1, p2, t);\n var p6 = midPoint(p2, p3, t);\n var p7 = midPoint(p4, p5, t);\n var p8 = midPoint(p5, p6, t);\n var p9 = midPoint(p7, p8, t);\n return [\n // @ts-ignore\n ['C'].concat(p4, p7, p9),\n // @ts-ignore\n ['C'].concat(p8, p6, p3),\n ];\n}\nfunction getCurveArray(segments) {\n return segments.map(function (segment, i, pathArray) {\n // @ts-ignore\n var segmentData = i && pathArray[i - 1].slice(-2).concat(segment.slice(1));\n // @ts-ignore\n var curveLength = i\n ? segmentCubicFactory(segmentData[0], segmentData[1], segmentData[2], segmentData[3], segmentData[4], segmentData[5], segmentData[6], segmentData[7], segmentData[8], { bbox: false }).length\n : 0;\n var subsegs;\n if (i) {\n // must be [segment,segment]\n subsegs = curveLength ? splitCubic(segmentData) : [segment, segment];\n }\n else {\n subsegs = [segment];\n }\n return {\n s: segment,\n ss: subsegs,\n l: curveLength,\n };\n });\n}\nexport function equalizeSegments(path1, path2, TL) {\n var c1 = getCurveArray(path1);\n var c2 = getCurveArray(path2);\n var L1 = c1.length;\n var L2 = c2.length;\n var l1 = c1.filter(function (x) { return x.l; }).length;\n var l2 = c2.filter(function (x) { return x.l; }).length;\n var m1 = c1.filter(function (x) { return x.l; }).reduce(function (a, _a) {\n var l = _a.l;\n return a + l;\n }, 0) / l1 || 0;\n var m2 = c2.filter(function (x) { return x.l; }).reduce(function (a, _a) {\n var l = _a.l;\n return a + l;\n }, 0) / l2 || 0;\n var tl = TL || Math.max(L1, L2);\n var mm = [m1, m2];\n var dif = [tl - L1, tl - L2];\n var canSplit = 0;\n var result = [c1, c2].map(function (x, i) {\n // @ts-ignore\n return x.l === tl\n ? x.map(function (y) { return y.s; })\n : x\n .map(function (y, j) {\n canSplit = j && dif[i] && y.l >= mm[i];\n dif[i] -= canSplit ? 1 : 0;\n return canSplit ? y.ss : [y.s];\n })\n .flat();\n });\n return result[0].length === result[1].length ? result : equalizeSegments(result[0], result[1], tl);\n}\n//# sourceMappingURL=equalize-segments.js.map","/**\n * Create DOM from a html string.\n * @param str\n * @returns\n */\nexport function createDOM(str) {\n var container = document.createElement('div');\n container.innerHTML = str;\n var dom = container.childNodes[0];\n if (dom && container.contains(dom)) {\n container.removeChild(dom);\n }\n return dom;\n}\n//# sourceMappingURL=create-dom.js.map","export function column(value, field) {\n if (value === null)\n return undefined;\n return { type: 'column', value, field };\n}\nexport function inferredColumn(value, field) {\n const c = column(value, field);\n return Object.assign(Object.assign({}, c), { inferred: true });\n}\nexport function visualColumn(value, field) {\n if (value === null)\n return undefined;\n return { type: 'column', value, field, visual: true };\n}\nexport function nonConstantColumn(value, field) {\n const c = column(value, field);\n return Object.assign(Object.assign({}, c), { constant: false });\n}\nexport function constant(I, value) {\n const array = [];\n for (const i of I)\n array[i] = value;\n return array;\n}\nexport function columnOf(encode, key) {\n const channel = encode[key];\n if (!channel)\n return [null, null];\n const { value, field = null } = channel;\n return [value, field];\n}\nexport function maybeColumnOf(encode, ...K) {\n for (const key of K) {\n if (typeof key === 'string') {\n const [KV, fv] = columnOf(encode, key);\n if (KV !== null)\n return [KV, fv];\n }\n else {\n return [key, null];\n }\n }\n return [null, null];\n}\nexport function isObject(d) {\n if (d instanceof Date)\n return false;\n return typeof d === 'object';\n}\n//# sourceMappingURL=helper.js.map","import { deepMix } from '@antv/util';\nimport { inferredColumn, constant } from './utils/helper';\n/**\n * Add zero constant encode for y1 channel.\n */\nexport const MaybeZeroY1 = () => {\n return (I, mark) => {\n const { encode } = mark;\n const { y1 } = encode;\n if (y1 !== undefined)\n return [I, mark];\n return [\n I,\n deepMix({}, mark, {\n encode: { y1: inferredColumn(constant(I, 0)) },\n }),\n ];\n };\n};\nMaybeZeroY1.props = {};\n//# sourceMappingURL=maybeZeroY1.js.map","export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n","import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can’t do this\n // for a comparator (except for specific, known comparators) because we can’t\n // tell if the comparator is symmetric, and an asymmetric comparator can’t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n","export default function number(x) {\n return x === null ? NaN : +x;\n}\n\nexport function* numbers(values, valueof) {\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n","import ascending from \"./ascending.js\";\nimport bisector from \"./bisector.js\";\nimport number from \"./number.js\";\n\nconst ascendingBisect = bisector(ascending);\nexport const bisectRight = ascendingBisect.right;\nexport const bisectLeft = ascendingBisect.left;\nexport const bisectCenter = bisector(number).center;\nexport default bisectRight;\n","export default function count(values, valueof) {\n let count = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n ++count;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n ++count;\n }\n }\n }\n return count;\n}\n","export default function variance(values, valueof) {\n let count = 0;\n let delta;\n let mean = 0;\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n delta = value - mean;\n mean += delta / ++count;\n sum += delta * (value - mean);\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n delta = value - mean;\n mean += delta / ++count;\n sum += delta * (value - mean);\n }\n }\n }\n if (count > 1) return sum / (count - 1);\n}\n","import variance from \"./variance.js\";\n\nexport default function deviation(values, valueof) {\n const v = variance(values, valueof);\n return v ? Math.sqrt(v) : v;\n}\n","export default function extent(values, valueof) {\n let min;\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n }\n return [min, max];\n}\n","// https://github.com/python/cpython/blob/a74eea238f5baba15797e2e8b570d153bc8690a7/Modules/mathmodule.c#L1423\nexport class Adder {\n constructor() {\n this._partials = new Float64Array(32);\n this._n = 0;\n }\n add(x) {\n const p = this._partials;\n let i = 0;\n for (let j = 0; j < this._n && j < 32; j++) {\n const y = p[j],\n hi = x + y,\n lo = Math.abs(x) < Math.abs(y) ? x - (hi - y) : y - (hi - x);\n if (lo) p[i++] = lo;\n x = hi;\n }\n p[i] = x;\n this._n = i + 1;\n return this;\n }\n valueOf() {\n const p = this._partials;\n let n = this._n, x, y, lo, hi = 0;\n if (n > 0) {\n hi = p[--n];\n while (n > 0) {\n x = hi;\n y = p[--n];\n hi = x + y;\n lo = y - (hi - x);\n if (lo) break;\n }\n if (n > 0 && ((lo < 0 && p[n - 1] < 0) || (lo > 0 && p[n - 1] > 0))) {\n y = lo * 2;\n x = hi + y;\n if (y == x - hi) hi = x;\n }\n }\n return hi;\n }\n}\n\nexport function fsum(values, valueof) {\n const adder = new Adder();\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n adder.add(value);\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n adder.add(value);\n }\n }\n }\n return +adder;\n}\n\nexport function fcumsum(values, valueof) {\n const adder = new Adder();\n let index = -1;\n return Float64Array.from(values, valueof === undefined\n ? v => adder.add(+v || 0)\n : v => adder.add(+valueof(v, ++index, values) || 0)\n );\n}\n","export class InternMap extends Map {\n constructor(entries, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (entries != null) for (const [key, value] of entries) this.set(key, value);\n }\n get(key) {\n return super.get(intern_get(this, key));\n }\n has(key) {\n return super.has(intern_get(this, key));\n }\n set(key, value) {\n return super.set(intern_set(this, key), value);\n }\n delete(key) {\n return super.delete(intern_delete(this, key));\n }\n}\n\nexport class InternSet extends Set {\n constructor(values, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (values != null) for (const value of values) this.add(value);\n }\n has(value) {\n return super.has(intern_get(this, value));\n }\n add(value) {\n return super.add(intern_set(this, value));\n }\n delete(value) {\n return super.delete(intern_delete(this, value));\n }\n}\n\nfunction intern_get({_intern, _key}, value) {\n const key = _key(value);\n return _intern.has(key) ? _intern.get(key) : value;\n}\n\nfunction intern_set({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) return _intern.get(key);\n _intern.set(key, value);\n return value;\n}\n\nfunction intern_delete({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) {\n value = _intern.get(key);\n _intern.delete(key);\n }\n return value;\n}\n\nfunction keyof(value) {\n return value !== null && typeof value === \"object\" ? value.valueOf() : value;\n}\n","export default function identity(x) {\n return x;\n}\n","import {InternMap} from \"internmap\";\nimport identity from \"./identity.js\";\n\nexport default function group(values, ...keys) {\n return nest(values, identity, identity, keys);\n}\n\nexport function groups(values, ...keys) {\n return nest(values, Array.from, identity, keys);\n}\n\nfunction flatten(groups, keys) {\n for (let i = 1, n = keys.length; i < n; ++i) {\n groups = groups.flatMap(g => g.pop().map(([key, value]) => [...g, key, value]));\n }\n return groups;\n}\n\nexport function flatGroup(values, ...keys) {\n return flatten(groups(values, ...keys), keys);\n}\n\nexport function flatRollup(values, reduce, ...keys) {\n return flatten(rollups(values, reduce, ...keys), keys);\n}\n\nexport function rollup(values, reduce, ...keys) {\n return nest(values, identity, reduce, keys);\n}\n\nexport function rollups(values, reduce, ...keys) {\n return nest(values, Array.from, reduce, keys);\n}\n\nexport function index(values, ...keys) {\n return nest(values, identity, unique, keys);\n}\n\nexport function indexes(values, ...keys) {\n return nest(values, Array.from, unique, keys);\n}\n\nfunction unique(values) {\n if (values.length !== 1) throw new Error(\"duplicate key\");\n return values[0];\n}\n\nfunction nest(values, map, reduce, keys) {\n return (function regroup(values, i) {\n if (i >= keys.length) return reduce(values);\n const groups = new InternMap();\n const keyof = keys[i++];\n let index = -1;\n for (const value of values) {\n const key = keyof(value, ++index, values);\n const group = groups.get(key);\n if (group) group.push(value);\n else groups.set(key, [value]);\n }\n for (const [key, values] of groups) {\n groups.set(key, regroup(values, i));\n }\n return map(groups);\n })(values, 0);\n}\n","export default function permute(source, keys) {\n return Array.from(keys, key => source[key]);\n}\n","import ascending from \"./ascending.js\";\nimport permute from \"./permute.js\";\n\nexport default function sort(values, ...F) {\n if (typeof values[Symbol.iterator] !== \"function\") throw new TypeError(\"values is not iterable\");\n values = Array.from(values);\n let [f] = F;\n if ((f && f.length !== 2) || F.length > 1) {\n const index = Uint32Array.from(values, (d, i) => i);\n if (F.length > 1) {\n F = F.map(f => values.map(f));\n index.sort((i, j) => {\n for (const f of F) {\n const c = ascendingDefined(f[i], f[j]);\n if (c) return c;\n }\n });\n } else {\n f = values.map(f);\n index.sort((i, j) => ascendingDefined(f[i], f[j]));\n }\n return permute(values, index);\n }\n return values.sort(compareDefined(f));\n}\n\nexport function compareDefined(compare = ascending) {\n if (compare === ascending) return ascendingDefined;\n if (typeof compare !== \"function\") throw new TypeError(\"compare is not a function\");\n return (a, b) => {\n const x = compare(a, b);\n if (x || x === 0) return x;\n return (compare(b, b) === 0) - (compare(a, a) === 0);\n };\n}\n\nexport function ascendingDefined(a, b) {\n return (a == null || !(a >= a)) - (b == null || !(b >= b)) || (a < b ? -1 : a > b ? 1 : 0);\n}\n","import ascending from \"./ascending.js\";\nimport group, {rollup} from \"./group.js\";\nimport sort from \"./sort.js\";\n\nexport default function groupSort(values, reduce, key) {\n return (reduce.length !== 2\n ? sort(rollup(values, reduce, key), (([ak, av], [bk, bv]) => ascending(av, bv) || ascending(ak, bk)))\n : sort(group(values, key), (([ak, av], [bk, bv]) => reduce(av, bv) || ascending(ak, bk))))\n .map(([key]) => key);\n}\n","var array = Array.prototype;\n\nexport var slice = array.slice;\nexport var map = array.map;\n","export default function constant(x) {\n return () => x;\n}\n","const e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nfunction tickSpec(start, stop, count) {\n const step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log10(step)),\n error = step / Math.pow(10, power),\n factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;\n let i1, i2, inc;\n if (power < 0) {\n inc = Math.pow(10, -power) / factor;\n i1 = Math.round(start * inc);\n i2 = Math.round(stop * inc);\n if (i1 / inc < start) ++i1;\n if (i2 / inc > stop) --i2;\n inc = -inc;\n } else {\n inc = Math.pow(10, power) * factor;\n i1 = Math.round(start / inc);\n i2 = Math.round(stop / inc);\n if (i1 * inc < start) ++i1;\n if (i2 * inc > stop) --i2;\n }\n if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);\n return [i1, i2, inc];\n}\n\nexport default function ticks(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n if (!(count > 0)) return [];\n if (start === stop) return [start];\n const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);\n if (!(i2 >= i1)) return [];\n const n = i2 - i1 + 1, ticks = new Array(n);\n if (reverse) {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;\n } else {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;\n }\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n return tickSpec(start, stop, count)[2];\n}\n\nexport function tickStep(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);\n return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);\n}\n","import {tickIncrement} from \"./ticks.js\";\n\nexport default function nice(start, stop, count) {\n let prestep;\n while (true) {\n const step = tickIncrement(start, stop, count);\n if (step === prestep || step === 0 || !isFinite(step)) {\n return [start, stop];\n } else if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n }\n prestep = step;\n }\n}\n","import count from \"../count.js\";\n\nexport default function thresholdSturges(values) {\n return Math.max(1, Math.ceil(Math.log(count(values)) / Math.LN2) + 1);\n}\n","import {slice} from \"./array.js\";\nimport bisect from \"./bisect.js\";\nimport constant from \"./constant.js\";\nimport extent from \"./extent.js\";\nimport identity from \"./identity.js\";\nimport nice from \"./nice.js\";\nimport ticks, {tickIncrement} from \"./ticks.js\";\nimport sturges from \"./threshold/sturges.js\";\n\nexport default function bin() {\n var value = identity,\n domain = extent,\n threshold = sturges;\n\n function histogram(data) {\n if (!Array.isArray(data)) data = Array.from(data);\n\n var i,\n n = data.length,\n x,\n step,\n values = new Array(n);\n\n for (i = 0; i < n; ++i) {\n values[i] = value(data[i], i, data);\n }\n\n var xz = domain(values),\n x0 = xz[0],\n x1 = xz[1],\n tz = threshold(values, x0, x1);\n\n // Convert number of thresholds into uniform thresholds, and nice the\n // default domain accordingly.\n if (!Array.isArray(tz)) {\n const max = x1, tn = +tz;\n if (domain === extent) [x0, x1] = nice(x0, x1, tn);\n tz = ticks(x0, x1, tn);\n\n // If the domain is aligned with the first tick (which it will by\n // default), then we can use quantization rather than bisection to bin\n // values, which is substantially faster.\n if (tz[0] <= x0) step = tickIncrement(x0, x1, tn);\n\n // If the last threshold is coincident with the domain’s upper bound, the\n // last bin will be zero-width. If the default domain is used, and this\n // last threshold is coincident with the maximum input value, we can\n // extend the niced upper bound by one tick to ensure uniform bin widths;\n // otherwise, we simply remove the last threshold. Note that we don’t\n // coerce values or the domain to numbers, and thus must be careful to\n // compare order (>=) rather than strict equality (===)!\n if (tz[tz.length - 1] >= x1) {\n if (max >= x1 && domain === extent) {\n const step = tickIncrement(x0, x1, tn);\n if (isFinite(step)) {\n if (step > 0) {\n x1 = (Math.floor(x1 / step) + 1) * step;\n } else if (step < 0) {\n x1 = (Math.ceil(x1 * -step) + 1) / -step;\n }\n }\n } else {\n tz.pop();\n }\n }\n }\n\n // Remove any thresholds outside the domain.\n // Be careful not to mutate an array owned by the user!\n var m = tz.length, a = 0, b = m;\n while (tz[a] <= x0) ++a;\n while (tz[b - 1] > x1) --b;\n if (a || b < m) tz = tz.slice(a, b), m = b - a;\n\n var bins = new Array(m + 1),\n bin;\n\n // Initialize bins.\n for (i = 0; i <= m; ++i) {\n bin = bins[i] = [];\n bin.x0 = i > 0 ? tz[i - 1] : x0;\n bin.x1 = i < m ? tz[i] : x1;\n }\n\n // Assign data to bins by value, ignoring any outside the domain.\n if (isFinite(step)) {\n if (step > 0) {\n for (i = 0; i < n; ++i) {\n if ((x = values[i]) != null && x0 <= x && x <= x1) {\n bins[Math.min(m, Math.floor((x - x0) / step))].push(data[i]);\n }\n }\n } else if (step < 0) {\n for (i = 0; i < n; ++i) {\n if ((x = values[i]) != null && x0 <= x && x <= x1) {\n const j = Math.floor((x0 - x) * step);\n bins[Math.min(m, j + (tz[j] <= x))].push(data[i]); // handle off-by-one due to rounding\n }\n }\n }\n } else {\n for (i = 0; i < n; ++i) {\n if ((x = values[i]) != null && x0 <= x && x <= x1) {\n bins[bisect(tz, x, 0, m)].push(data[i]);\n }\n }\n }\n\n return bins;\n }\n\n histogram.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(_), histogram) : value;\n };\n\n histogram.domain = function(_) {\n return arguments.length ? (domain = typeof _ === \"function\" ? _ : constant([_[0], _[1]]), histogram) : domain;\n };\n\n histogram.thresholds = function(_) {\n return arguments.length ? (threshold = typeof _ === \"function\" ? _ : constant(Array.isArray(_) ? slice.call(_) : _), histogram) : threshold;\n };\n\n return histogram;\n}\n","export default function max(values, valueof) {\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n }\n return max;\n}\n","export default function maxIndex(values, valueof) {\n let max;\n let maxIndex = -1;\n let index = -1;\n if (valueof === undefined) {\n for (const value of values) {\n ++index;\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value, maxIndex = index;\n }\n }\n } else {\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value, maxIndex = index;\n }\n }\n }\n return maxIndex;\n}\n","export default function min(values, valueof) {\n let min;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n }\n return min;\n}\n","export default function minIndex(values, valueof) {\n let min;\n let minIndex = -1;\n let index = -1;\n if (valueof === undefined) {\n for (const value of values) {\n ++index;\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value, minIndex = index;\n }\n }\n } else {\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value, minIndex = index;\n }\n }\n }\n return minIndex;\n}\n","import {ascendingDefined, compareDefined} from \"./sort.js\";\n\n// Based on https://github.com/mourner/quickselect\n// ISC license, Copyright 2018 Vladimir Agafonkin.\nexport default function quickselect(array, k, left = 0, right = Infinity, compare) {\n k = Math.floor(k);\n left = Math.floor(Math.max(0, left));\n right = Math.floor(Math.min(array.length - 1, right));\n\n if (!(left <= k && k <= right)) return array;\n\n compare = compare === undefined ? ascendingDefined : compareDefined(compare);\n\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselect(array, k, newLeft, newRight, compare);\n }\n\n const t = array[k];\n let i = left;\n let j = right;\n\n swap(array, left, k);\n if (compare(array[right], t) > 0) swap(array, left, right);\n\n while (i < j) {\n swap(array, i, j), ++i, --j;\n while (compare(array[i], t) < 0) ++i;\n while (compare(array[j], t) > 0) --j;\n }\n\n if (compare(array[left], t) === 0) swap(array, left, j);\n else ++j, swap(array, j, right);\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n\n return array;\n}\n\nfunction swap(array, i, j) {\n const t = array[i];\n array[i] = array[j];\n array[j] = t;\n}\n","import ascending from \"./ascending.js\";\n\nexport default function greatest(values, compare = ascending) {\n let max;\n let defined = false;\n if (compare.length === 1) {\n let maxValue;\n for (const element of values) {\n const value = compare(element);\n if (defined\n ? ascending(value, maxValue) > 0\n : ascending(value, value) === 0) {\n max = element;\n maxValue = value;\n defined = true;\n }\n }\n } else {\n for (const value of values) {\n if (defined\n ? compare(value, max) > 0\n : compare(value, value) === 0) {\n max = value;\n defined = true;\n }\n }\n }\n return max;\n}\n","import max from \"./max.js\";\nimport maxIndex from \"./maxIndex.js\";\nimport min from \"./min.js\";\nimport minIndex from \"./minIndex.js\";\nimport quickselect from \"./quickselect.js\";\nimport number, {numbers} from \"./number.js\";\nimport {ascendingDefined} from \"./sort.js\";\nimport greatest from \"./greatest.js\";\n\nexport default function quantile(values, p, valueof) {\n values = Float64Array.from(numbers(values, valueof));\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return min(values);\n if (p >= 1) return max(values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = max(quickselect(values, i0).subarray(0, i0 + 1)),\n value1 = min(values.subarray(i0 + 1));\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileSorted(values, p, valueof = number) {\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return +valueof(values[0], 0, values);\n if (p >= 1) return +valueof(values[n - 1], n - 1, values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = +valueof(values[i0], i0, values),\n value1 = +valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileIndex(values, p, valueof = number) {\n if (isNaN(p = +p)) return;\n numbers = Float64Array.from(values, (_, i) => number(valueof(values[i], i, values)));\n if (p <= 0) return minIndex(numbers);\n if (p >= 1) return maxIndex(numbers);\n var numbers,\n index = Uint32Array.from(values, (_, i) => i),\n j = numbers.length - 1,\n i = Math.floor(j * p);\n quickselect(index, i, 0, j, (i, j) => ascendingDefined(numbers[i], numbers[j]));\n i = greatest(index.subarray(0, i + 1), (i) => numbers[i]);\n return i >= 0 ? i : -1;\n}\n","import count from \"../count.js\";\nimport deviation from \"../deviation.js\";\n\nexport default function thresholdScott(values, min, max) {\n const c = count(values), d = deviation(values);\n return c && d ? Math.ceil((max - min) * Math.cbrt(c) / (3.49 * d)) : 1;\n}\n","export default function mean(values, valueof) {\n let count = 0;\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n ++count, sum += value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n ++count, sum += value;\n }\n }\n }\n if (count) return sum / count;\n}\n","import quantile, {quantileIndex} from \"./quantile.js\";\n\nexport default function median(values, valueof) {\n return quantile(values, 0.5, valueof);\n}\n\nexport function medianIndex(values, valueof) {\n return quantileIndex(values, 0.5, valueof);\n}\n","function* flatten(arrays) {\n for (const array of arrays) {\n yield* array;\n }\n}\n\nexport default function merge(arrays) {\n return Array.from(flatten(arrays));\n}\n","export default function range(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n","export default function sum(values, valueof) {\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n sum += value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n sum += value;\n }\n }\n }\n return sum;\n}\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { lowerFirst, upperFirst, isPlainObject } from '@antv/util';\nexport function identity(x) {\n return x;\n}\n/**\n * Composes functions from left to right.\n */\nexport function compose(fns) {\n return fns.reduce((composed, fn) => (x, ...args) => fn(composed(x, ...args), ...args), identity);\n}\n/**\n * Composes single-argument async functions from left to right.\n */\nexport function composeAsync(fns) {\n return fns.reduce((composed, fn) => (x) => __awaiter(this, void 0, void 0, function* () {\n const value = yield composed(x);\n return fn(value);\n }), identity);\n}\nexport function capitalizeFirst(str) {\n return str.replace(/( |^)[a-z]/g, (L) => L.toUpperCase());\n}\nexport function error(message = '') {\n throw new Error(message);\n}\nexport function copyAttributes(target, source) {\n const { attributes } = source;\n const exclude = new Set(['id', 'className']);\n for (const [key, value] of Object.entries(attributes)) {\n if (!exclude.has(key)) {\n // @todo Fix in @antv/g\n if (key === 'transform') {\n target.attr(key, '');\n target.attr(key, value);\n }\n else {\n target.attr(key, value);\n }\n }\n }\n}\nexport function defined(x) {\n return x !== undefined && x !== null && !Number.isNaN(x);\n}\nexport function random(a, b) {\n return a + (b - a) * Math.random();\n}\nexport function useMemo(compute) {\n const map = new Map();\n return (key) => {\n if (map.has(key))\n return map.get(key);\n const value = compute(key);\n map.set(key, value);\n return value;\n };\n}\nexport function appendTransform(node, transform) {\n const { transform: preTransform } = node.style;\n const unset = (d) => d === 'none' || d === undefined;\n const prefix = unset(preTransform) ? '' : preTransform;\n node.style.transform = `${prefix} ${transform}`.trimStart();\n}\nexport function subObject(obj, prefix) {\n return maybeSubObject(obj, prefix) || {};\n}\nexport function maybeSubObject(obj, prefix) {\n const entries = Object.entries(obj || {})\n .filter(([key]) => key.startsWith(prefix))\n .map(([key, value]) => [lowerFirst(key.replace(prefix, '').trim()), value])\n .filter(([key]) => !!key);\n return entries.length === 0 ? null : Object.fromEntries(entries);\n}\nexport function prefixObject(obj, prefix) {\n return Object.fromEntries(Object.entries(obj).map(([key, value]) => {\n return [`${prefix}${upperFirst(key)}`, value];\n }));\n}\nexport function filterPrefixObject(obj, prefix) {\n return Object.fromEntries(Object.entries(obj).filter(([key]) => prefix.find((p) => key.startsWith(p))));\n}\nexport function omitPrefixObject(obj, ...prefixes) {\n return Object.fromEntries(Object.entries(obj).filter(([key]) => prefixes.every((prefix) => !key.startsWith(prefix))));\n}\nexport function maybePercentage(x, size) {\n if (x === undefined)\n return null;\n if (typeof x === 'number')\n return x;\n const px = +x.replace('%', '');\n return Number.isNaN(px) ? null : (px / 100) * size;\n}\nexport function isStrictObject(d) {\n return (typeof d === 'object' &&\n !(d instanceof Date) &&\n d !== null &&\n !Array.isArray(d));\n}\nexport function isUnset(value) {\n return value === null || value === false;\n}\nexport function deepAssign(dist, src, maxLevel = 5, level = 0) {\n if (level >= maxLevel)\n return;\n for (const key of Object.keys(src)) {\n const value = src[key];\n if (!isPlainObject(value) || !isPlainObject(dist[key])) {\n dist[key] = value;\n }\n else {\n deepAssign(dist[key], value, maxLevel, level + 1);\n }\n }\n return dist;\n}\n//# sourceMappingURL=helper.js.map","/**\n * Calls a defined callback function on each key:value of a object,\n * and returns a object contains the result.\n */\nexport function mapObject(object, callbackfn) {\n return Object.entries(object).reduce((obj, [key, value]) => {\n obj[key] = callbackfn(value, key, object);\n return obj;\n }, {});\n}\nexport function indexOf(array) {\n return array.map((_, i) => i);\n}\n/**\n * @example [[1, 2, 3], ['a', 'b', 'c']] => [[1, 'a'], [2, 'b'], [3, 'c']]\n */\nexport function transpose(matrix) {\n const row = matrix.length;\n const col = matrix[0].length;\n // Note: new Array(col).fill(new Array(row)) is not ok!!!\n // Because in this case it will fill new Array(col) with the same array: new Array(row).\n const transposed = new Array(col).fill(0).map(() => new Array(row));\n for (let i = 0; i < col; i++) {\n for (let j = 0; j < row; j++) {\n transposed[i][j] = matrix[j][i];\n }\n }\n return transposed;\n}\nexport function firstOf(array) {\n return array[0];\n}\nexport function lastOf(array) {\n return array[array.length - 1];\n}\nexport function isFlatArray(array) {\n return !array.some(Array.isArray);\n}\nexport function unique(array) {\n return Array.from(new Set(array));\n}\nexport function divide(array, callbackfn) {\n const result = [[], []];\n array.forEach((item) => {\n result[callbackfn(item) ? 0 : 1].push(item);\n });\n return result;\n}\nfunction comb(array, len = array.length) {\n if (len === 1)\n return array.map((item) => [item]);\n const result = [];\n for (let i = 0; i < array.length; i++) {\n const rest = array.slice(i + 1);\n const restComb = comb(rest, len - 1);\n restComb.forEach((comb) => {\n result.push([array[i], ...comb]);\n });\n }\n return result;\n}\n/**\n * get all combinations of two elements in an array\n * @example [1, 2, 3] => [[1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]]\n * @param array\n * @returns\n */\nexport function combine(array) {\n if (array.length === 1)\n return [array];\n const result = [];\n for (let i = 1; i <= array.length; i++) {\n result.push(...comb(array, i));\n }\n return result;\n}\n//# sourceMappingURL=array.js.map","import { group, ascending, maxIndex } from 'd3-array';\nimport { defined } from '../../utils/helper';\nimport { indexOf } from '../../utils/array';\nimport { columnOf } from './helper';\nexport function createGroups(groupBy, I, mark) {\n const { encode } = mark;\n if (groupBy === null)\n return [I];\n const G = normalizeGroupBy(groupBy)\n .map((k) => { var _a; return [k, (_a = columnOf(encode, k)) === null || _a === void 0 ? void 0 : _a[0]]; })\n .filter(([, column]) => defined(column));\n const key = (i) => G.map(([, V]) => V[i]).join('-');\n return Array.from(group(I, key).values());\n}\nexport function normalizeComparator(order) {\n if (Array.isArray(order))\n return createFieldsOrder(order);\n if (typeof order === 'function')\n return createFunctionOrder(order);\n if (order === 'series')\n return createSeriesOrder;\n if (order === 'value')\n return createValueOrder;\n if (order === 'sum')\n return createSumOrder;\n if (order === 'maxIndex')\n return createMaxIndexOrder;\n return () => null;\n}\nexport function applyOrder(groups, comparator) {\n for (const group of groups) {\n group.sort(comparator);\n }\n}\nexport function domainOf(value, scale) {\n return (scale === null || scale === void 0 ? void 0 : scale.domain) || Array.from(new Set(value));\n}\nfunction normalizeGroupBy(groupBy) {\n if (Array.isArray(groupBy))\n return groupBy;\n return [groupBy];\n}\nfunction createSeriesOrder(data, Y, S) {\n return ascendingComparator((i) => S[i]);\n}\nfunction createFunctionOrder(order) {\n return (data, Y, S) => {\n return ascendingComparator((i) => order(data[i]));\n };\n}\nfunction createFieldsOrder(order) {\n return (data, Y, S) => {\n return (i, j) => order.reduce((eq, f) => (eq !== 0 ? eq : ascending(data[i][f], data[j][f])), 0);\n };\n}\nfunction createValueOrder(data, Y, S) {\n return ascendingComparator((i) => Y[i]);\n}\nfunction createSumOrder(data, Y, S) {\n const I = indexOf(data);\n const groups = Array.from(group(I, (i) => S[+i]).entries());\n const seriesSum = new Map(groups.map(([k, GI]) => [k, GI.reduce((s, i) => s + +Y[i])]));\n return ascendingComparator((i) => seriesSum.get(S[i]));\n}\nfunction createMaxIndexOrder(data, Y, S) {\n const I = indexOf(data);\n const groups = Array.from(group(I, (i) => S[+i]).entries());\n const seriesMaxIndex = new Map(groups.map(([k, GI]) => [k, maxIndex(GI, (i) => Y[i])]));\n return ascendingComparator((i) => seriesMaxIndex.get(S[i]));\n}\nfunction ascendingComparator(order) {\n return (i, j) => ascending(order(i), order(j));\n}\n//# sourceMappingURL=order.js.map","import { deepMix } from '@antv/util';\nimport { column, columnOf, inferredColumn, maybeColumnOf, } from './utils/helper';\nimport { normalizeComparator, createGroups, applyOrder } from './utils/order';\n/**\n * The stack transform group marks into series by color channel,\n * and then produce new y channel for each series by specified order,\n * say to form vertical \"stacks\" by specified channels.\n */\nexport const StackY = (options = {}) => {\n const { groupBy = 'x', orderBy = null, reverse = false, y: fromY = 'y', y1: fromY1 = 'y1', series = true, } = options;\n return (I, mark) => {\n const { data, encode, style = {} } = mark;\n const [Y, fy] = columnOf(encode, 'y');\n const [Y1, fy1] = columnOf(encode, 'y1');\n const [S] = series\n ? maybeColumnOf(encode, 'series', 'color')\n : columnOf(encode, 'color');\n // Create groups and apply specified order for each group.\n const groups = createGroups(groupBy, I, mark);\n const createComparator = normalizeComparator(orderBy);\n const comparator = createComparator(data, Y, S);\n if (comparator)\n applyOrder(groups, comparator);\n // Stack y channels to produce new y and y1 channel.\n const newY = new Array(I.length);\n const newY1 = new Array(I.length);\n const TY = new Array(I.length);\n const F = [];\n const L = [];\n for (const G of groups) {\n if (reverse)\n G.reverse();\n // For range interval with specified y and y1.\n const start = Y1 ? +Y1[G[0]] : 0;\n // Split positive indices of Y and negative Y.\n const PG = [];\n const NG = [];\n for (const i of G) {\n const y = (TY[i] = +Y[i] - start);\n if (y < 0)\n NG.push(i);\n else if (y >= 0)\n PG.push(i);\n }\n // Store the first and last layer.\n const FG = PG.length > 0 ? PG : NG;\n const LG = NG.length > 0 ? NG : PG;\n let i = PG.length - 1;\n let j = 0;\n // Find the last non-zero index.\n while (i > 0 && Y[FG[i]] === 0)\n i--;\n // Find the first non-zero index.\n while (j < LG.length - 1 && Y[LG[j]] === 0)\n j++;\n F.push(FG[i]);\n L.push(LG[j]);\n // Stack negative y in reverse order.\n let ny = start;\n for (const i of NG.reverse()) {\n const y = TY[i];\n ny = newY[i] = (newY1[i] = ny) + y;\n }\n // Stack positive y in input order.\n let py = start;\n for (const i of PG) {\n const y = TY[i];\n if (y > 0)\n py = newY[i] = (newY1[i] = py) + y;\n else\n newY[i] = newY1[i] = py;\n }\n }\n // Only set top radius for the first layer,\n // and set bottom radius for the last layer.\n const FS = new Set(F);\n const LS = new Set(L);\n // Choose new y or y1 channel as the new y channel.\n const V = fromY === 'y' ? newY : newY1;\n const V1 = fromY1 === 'y' ? newY : newY1;\n return [\n I,\n deepMix({}, mark, {\n encode: {\n y0: inferredColumn(Y, fy),\n y: column(V, fy),\n y1: column(V1, fy1),\n },\n style: Object.assign({ first: (_, i) => FS.has(i), last: (_, i) => LS.has(i) }, style),\n }),\n ];\n };\n};\nStackY.props = {};\n//# sourceMappingURL=stackY.js.map","function fillZero(digit) {\n if (Math.abs(digit) > 10)\n return String(digit);\n return digit.toString().padStart(2, '0');\n}\nexport function dynamicFormatDateTime(date) {\n const year = date.getFullYear();\n const month = fillZero(date.getMonth() + 1);\n const day = fillZero(date.getDate());\n const yyyyMMDD = `${year}-${month}-${day}`;\n const hour = date.getHours();\n const minutes = date.getMinutes();\n const seconds = date.getSeconds();\n if (hour || minutes || seconds)\n return `${yyyyMMDD} ${fillZero(hour)}:${fillZero(minutes)}:${fillZero(seconds)}`;\n return yyyyMMDD;\n}\n//# sourceMappingURL=dateFormat.js.map","import { deepMix } from '@antv/util';\nimport { isUnset } from '../utils/helper';\nimport { dynamicFormatDateTime } from '../utils/dateFormat';\nimport { columnOf } from './utils/helper';\n/**\n * Infer title channel from x-position channel.\n */\nexport const MaybeTitle = (options = {}) => {\n const { channel = 'x' } = options;\n return (I, mark) => {\n const { encode } = mark;\n const { tooltip } = mark;\n if (isUnset(tooltip))\n return [I, mark];\n const { title } = tooltip;\n if (title !== undefined)\n return [I, mark];\n const titles = Object.keys(encode)\n .filter((key) => key.startsWith(channel))\n .filter((key) => !encode[key].inferred)\n .map((key) => columnOf(encode, key))\n .filter(([T]) => T)\n .map((d) => d[0]);\n if (titles.length === 0)\n return [I, mark];\n const T = [];\n for (const i of I) {\n T[i] = {\n value: titles\n .map((t) => t[i] instanceof Date ? dynamicFormatDateTime(t[i]) : t[i])\n .join(', '),\n };\n }\n return [\n I,\n deepMix({}, mark, {\n tooltip: {\n title: T,\n },\n }),\n ];\n };\n};\nMaybeTitle.props = {};\n//# sourceMappingURL=maybeTitle.js.map","import { deepMix } from '@antv/util';\nimport { inferredColumn, constant } from './utils/helper';\n/**\n * Add zero constant encode for x channel.\n * This is useful for interval geometry.\n */\nexport const MaybeZeroX = () => {\n return (I, mark) => {\n const { encode } = mark;\n const { x } = encode;\n if (x !== undefined)\n return [I, mark];\n return [\n I,\n deepMix({}, mark, {\n encode: { x: inferredColumn(constant(I, 0)) },\n scale: { x: { guide: null } },\n }),\n ];\n };\n};\nMaybeZeroX.props = {};\n//# sourceMappingURL=maybeZeroX.js.map","import { deepMix } from '@antv/util';\nimport { inferredColumn, constant } from './utils/helper';\n/**\n * Add zero constant encode for y channel.\n */\nexport const MaybeZeroY = () => {\n return (I, mark) => {\n const { encode } = mark;\n const { y } = encode;\n if (y !== undefined)\n return [I, mark];\n return [\n I,\n deepMix({}, mark, {\n encode: { y: inferredColumn(constant(I, 0)) },\n scale: { y: { guide: null } },\n }),\n ];\n };\n};\nMaybeZeroY.props = {};\n//# sourceMappingURL=maybeZeroY.js.map","import { deepMix } from '@antv/util';\nimport { constant, visualColumn } from './utils/helper';\n/**\n * Add 3 constant encode for size channel.\n * This is useful for point geometry.\n */\nexport const MaybeSize = () => {\n return (I, mark) => {\n const { encode } = mark;\n const { size } = encode;\n if (size !== undefined)\n return [I, mark];\n return [\n I,\n deepMix({}, mark, { encode: { size: visualColumn(constant(I, 3)) } }),\n ];\n };\n};\nMaybeSize.props = {};\n//# sourceMappingURL=maybeSize.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { deepMix } from '@antv/util';\nimport { column } from './utils/helper';\n/**\n * Infer key for every element.\n */\nexport const MaybeKey = () => {\n return (I, mark) => {\n const { encode } = mark;\n const { key } = encode, rest = __rest(encode, [\"key\"]);\n if (key !== undefined)\n return [I, mark];\n const values = Object.values(rest).map(({ value }) => value);\n const K = I.map((i) => values\n .filter(Array.isArray)\n .map((V) => V[i])\n .join('-'));\n return [I, deepMix({}, mark, { encode: { key: column(K) } })];\n };\n};\nMaybeKey.props = {};\n//# sourceMappingURL=maybeKey.js.map","import { deepMix } from '@antv/util';\nimport { column, columnOf } from './utils/helper';\n/**\n * Assume color channel is series channel.\n */\nexport const MaybeSeries = () => {\n return (I, mark) => {\n const { encode } = mark;\n const { series, color } = encode;\n if (series !== undefined || color === undefined)\n return [I, mark];\n const [C, fc] = columnOf(encode, 'color');\n return [I, deepMix({}, mark, { encode: { series: column(C, fc) } })];\n };\n};\nMaybeSeries.props = {};\n//# sourceMappingURL=maybeSeries.js.map","import { deepMix } from '@antv/util';\nimport { column, isObject } from './utils/helper';\n/**\n * Add 3 constant encode for size channel.\n * This is useful for point geometry.\n */\nexport const MaybeTupleY = () => {\n return (I, mark) => {\n const { data } = mark;\n if (!Array.isArray(data) || data.some(isObject))\n return [I, mark];\n return [I, deepMix({}, mark, { encode: { y: column(data) } })];\n };\n};\nMaybeTupleY.props = {};\n//# sourceMappingURL=maybeTupleY.js.map","import { deepMix } from '@antv/util';\nimport { column, isObject } from './utils/helper';\n/**\n * Add 3 constant encode for size channel.\n * This is useful for point geometry.\n */\nexport const MaybeTupleX = () => {\n return (I, mark) => {\n const { data } = mark;\n if (!Array.isArray(data) || data.some(isObject))\n return [I, mark];\n return [I, deepMix({}, mark, { encode: { x: column(data) } })];\n };\n};\nMaybeTupleX.props = {};\n//# sourceMappingURL=maybeTupleX.js.map","import { deepMix } from '@antv/util';\nimport { column, columnOf } from './utils/helper';\n/**\n * Add 3 constant encode for size channel.\n * This is useful for point geometry.\n */\nexport const MaybeIdentityY = () => {\n return (I, mark) => {\n const { encode } = mark;\n const { y1 } = encode;\n if (y1)\n return [I, mark];\n const [Y] = columnOf(encode, 'y');\n return [I, deepMix({}, mark, { encode: { y1: column([...Y]) } })];\n };\n};\nMaybeIdentityY.props = {};\n//# sourceMappingURL=maybeIdentityY.js.map","import { deepMix } from '@antv/util';\nimport { column, columnOf } from './utils/helper';\n/**\n * Add 3 constant encode for size channel.\n * This is useful for point geometry.\n */\nexport const MaybeIdentityX = () => {\n return (I, mark) => {\n const { encode } = mark;\n const { x1 } = encode;\n if (x1)\n return [I, mark];\n const [X] = columnOf(encode, 'x');\n return [I, deepMix({}, mark, { encode: { x1: column([...X]) } })];\n };\n};\nMaybeIdentityX.props = {};\n//# sourceMappingURL=maybeIdentityX.js.map","import { deepMix } from '@antv/util';\nimport { column, isObject } from './utils/helper';\n/**\n * Add a default encode for rangeX\n * when data is just an array\n */\nexport const MaybeDefaultX = () => {\n return (I, mark) => {\n const { data } = mark;\n if (Array.isArray(data) &&\n (data.every(Array.isArray) || !data.some(isObject))) {\n const extractX = (data, index) => Array.isArray(data[0])\n ? data.map((item) => item[index])\n : [data[index]];\n return [\n I,\n deepMix({}, mark, {\n encode: {\n x: column(extractX(data, 0)),\n x1: column(extractX(data, 1)),\n },\n }),\n ];\n }\n return [I, mark];\n };\n};\nMaybeDefaultX.props = {};\n//# sourceMappingURL=maybeDefaultX.js.map","import { deepMix } from '@antv/util';\nimport { column, isObject } from './utils/helper';\n/**\n * Add a default encode for rangeY\n * when data is just an array\n */\nexport const MaybeDefaultY = () => {\n return (I, mark) => {\n const { data } = mark;\n if (Array.isArray(data) &&\n (data.every(Array.isArray) || !data.some(isObject))) {\n const extractY = (data, index) => Array.isArray(data[0])\n ? data.map((item) => item[index])\n : [data[index]];\n return [\n I,\n deepMix({}, mark, {\n encode: {\n y: column(extractY(data, 0)),\n y1: column(extractY(data, 1)),\n },\n }),\n ];\n }\n return [I, mark];\n };\n};\nMaybeDefaultY.props = {};\n//# sourceMappingURL=maybeDefaultY.js.map","import { deepMix } from '@antv/util';\nimport { isUnset } from '../utils/helper';\n/**\n * Infer tooltip channel from specified channel.\n */\nexport const MaybeTooltip = (options) => {\n const { channel } = options;\n return (I, mark) => {\n const { encode, tooltip } = mark;\n if (isUnset(tooltip))\n return [I, mark];\n const { items = [] } = tooltip;\n if (!items || items.length > 0)\n return [I, mark];\n const channels = Array.isArray(channel) ? channel : [channel];\n const newItems = channels.flatMap((channel) => Object.keys(encode)\n .filter((key) => key.startsWith(channel))\n .map((key) => {\n const { field, value, inferred = false, aggregate } = encode[key];\n if (inferred)\n return null;\n // Do not show inferred column.\n if (aggregate && value)\n return { channel: key };\n if (field)\n return { field };\n if (value)\n return { channel: key };\n return null;\n })\n .filter((d) => d !== null));\n return [I, deepMix({}, mark, { tooltip: { items: newItems } })];\n };\n};\nMaybeTooltip.props = {};\n//# sourceMappingURL=maybeTooltip.js.map","import { deepMix } from '@antv/util';\n/**\n * Set padding of x and y scale to zero.\n */\nexport const MaybeZeroPadding = () => {\n return (I, mark) => {\n return [\n I,\n deepMix({ scale: { x: { padding: 0 }, y: { padding: 0 } } }, mark),\n ];\n };\n};\nMaybeZeroPadding.props = {};\n//# sourceMappingURL=maybeZeroPadding.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { deepMix } from '@antv/util';\nimport { column } from './utils/helper';\n/**\n * Set visual position with style.x and style.y.\n * The priority of style.x, style.y is higher than data.\n */\nexport const MaybeVisualPosition = () => {\n return (I, mark) => {\n const { data, style = {} } = mark, restMark = __rest(mark, [\"data\", \"style\"]);\n const { x: x0, y: y0 } = style, rest = __rest(style, [\"x\", \"y\"]);\n if (x0 == undefined || y0 == undefined)\n return [I, mark];\n const x = x0 || 0;\n const y = y0 || 0;\n return [\n [0],\n deepMix({}, restMark, {\n data: [0],\n cartesian: true,\n encode: {\n x: column([x]),\n y: column([y]),\n },\n scale: {\n x: { type: 'identity', independent: true, guide: null },\n y: { type: 'identity', independent: true, guide: null }, // hide axis\n },\n style: rest,\n }),\n ];\n };\n};\nMaybeVisualPosition.props = {};\n//# sourceMappingURL=maybeVisualPosition.js.map","import { deepMix } from '@antv/util';\n/**\n * Mark functional attribute constant.\n */\nexport const MaybeFunctionAttribute = () => {\n return (I, mark) => {\n const { style = {} } = mark;\n return [\n I,\n deepMix({}, mark, {\n style: Object.assign(Object.assign({}, style), Object.fromEntries(Object.entries(style)\n .filter(([, v]) => typeof v === 'function')\n .map(([k, v]) => [k, () => v]))),\n }),\n ];\n };\n};\nMaybeFunctionAttribute.props = {};\n//# sourceMappingURL=maybeFunctionAttribute.js.map","import { deepMix } from '@antv/util';\nimport { column, isObject } from './utils/helper';\n/**\n * Add 3 constant encode for size channel.\n * This is useful for point geometry.\n */\nexport const MaybeTuple = () => {\n return (I, mark) => {\n const { data } = mark;\n if (!Array.isArray(data) || data.some(isObject))\n return [I, mark];\n const position = Array.isArray(data[0]) ? data : [data];\n const X = position.map((d) => d[0]);\n const Y = position.map((d) => d[1]);\n return [I, deepMix({}, mark, { encode: { x: column(X), y: column(Y) } })];\n };\n};\nMaybeTuple.props = {};\n//# sourceMappingURL=maybeTuple.js.map","import { deepMix } from '@antv/util';\nimport { constant, visualColumn } from './utils/helper';\n/**\n * Add 3 constant encode for size channel.\n * This is useful for point geometry.\n */\nexport const MaybeGradient = () => {\n return (I, mark) => {\n const { style = {}, encode } = mark;\n const { series } = encode;\n const { gradient } = style;\n if (!gradient || series)\n return [I, mark];\n return [\n I,\n deepMix({}, mark, {\n encode: {\n series: visualColumn(constant(I, undefined)),\n },\n }),\n ];\n };\n};\nMaybeGradient.props = {};\n//# sourceMappingURL=maybeGradient.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { deepMix } from '@antv/util';\nimport { column, columnOf, maybeColumnOf } from './utils/helper';\nimport { createGroups, normalizeComparator, applyOrder, domainOf, } from './utils/order';\n/**\n * The dodge group marks into series by color or series channel,\n * and then produce new series channel for each series by specified order,\n * say to form horizontal \"columns\" by specified channels.\n */\nexport const DodgeX = (options = {}) => {\n const { groupBy = 'x', reverse = false, orderBy, padding } = options, rest = __rest(options, [\"groupBy\", \"reverse\", \"orderBy\", \"padding\"]);\n return (I, mark) => {\n const { data, encode, scale } = mark;\n const { series: scaleSeries } = scale;\n const [Y] = columnOf(encode, 'y');\n const [S] = maybeColumnOf(encode, 'series', 'color');\n const domainSeries = domainOf(S, scaleSeries);\n // Create groups and apply specified order for each group.\n const groups = createGroups(groupBy, I, mark);\n const createComparator = normalizeComparator(orderBy);\n const comparator = createComparator(data, Y, S);\n if (comparator)\n applyOrder(groups, comparator);\n // Update series for each mark related to series domain.\n const newS = new Array(I.length);\n for (const G of groups) {\n if (reverse)\n G.reverse();\n for (let i = 0; i < G.length; i++) {\n newS[G[i]] = domainSeries[i];\n }\n }\n return [\n I,\n deepMix({}, mark, {\n scale: {\n series: {\n domain: domainSeries,\n paddingInner: padding,\n },\n },\n encode: {\n series: column(newS),\n },\n }),\n ];\n };\n};\nDodgeX.props = {};\n//# sourceMappingURL=dodgeX.js.map","import { deepMix } from '@antv/util';\nimport { group, max } from 'd3-array';\nimport { columnOf, constant, maybeColumnOf, visualColumn, } from './utils/helper';\n/**\n * Group marks by channels into groups and stacking their enterDelay\n * to make marks show up groups by groups.\n * It will update enterDelay channel for each mark by its enterDuration and group.\n * @todo Support orderBy.\n * @todo Sort among groups(e.g. reverse).\n * @todo Stack enter in groups rather than between groups?\n * @todo Auto inter this statistic for scaleInY animation in stacked interval?\n * @todo All the groups shared the enterDuration?\n */\nexport const StackEnter = (options) => {\n const { groupBy = ['x'], reducer = (I, V) => V[I[0]], orderBy = null, reverse = false, duration, } = options;\n return (I, mark) => {\n const { encode } = mark;\n // Extract group information by each specified channel,\n // and skip if all values of channels are empty.\n const by = Array.isArray(groupBy) ? groupBy : [groupBy];\n const groupEntries = by.map((k) => [k, columnOf(encode, k)[0]]);\n if (groupEntries.length === 0)\n return [I, mark];\n // Nest group index and flatten them in right order among timeline.\n // [[1, 2, 3, 4, 5, 6]] ->\n // [[1, 2, 3], [4, 5, 6]] ->\n // [[1], [2], [3], [4], [5], [6]]\n let groups = [I];\n for (const [, V] of groupEntries) {\n const newGroups = [];\n for (const I of groups) {\n const G = Array.from(group(I, (i) => V[i]).values());\n // @todo sort by x.\n newGroups.push(...G);\n }\n groups = newGroups;\n }\n // const {color} = encode;\n if (orderBy) {\n const [V] = columnOf(encode, orderBy);\n if (V)\n groups.sort((I, J) => reducer(I, V) - reducer(J, V));\n if (reverse)\n groups.reverse();\n }\n // Stack delay for each group.\n const t = (duration || 3000) / groups.length;\n const [ED] = duration\n ? [constant(I, t)] // If specified duration, generate enter duration for each.\n : maybeColumnOf(encode, 'enterDuration', constant(I, t));\n const [EDL] = maybeColumnOf(encode, 'enterDelay', constant(I, 0));\n const newEnterDelay = new Array(I.length);\n for (let i = 0, pd = 0; i < groups.length; i++) {\n const I = groups[i];\n const maxDuration = max(I, (i) => +ED[i]);\n for (const j of I)\n newEnterDelay[j] = +EDL[j] + pd;\n pd += maxDuration;\n }\n return [\n I,\n deepMix({}, mark, {\n encode: {\n enterDuration: visualColumn(ED),\n enterDelay: visualColumn(newEnterDelay),\n },\n }),\n ];\n };\n};\nStackEnter.props = {};\n//# sourceMappingURL=stackEnter.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { deepMix } from '@antv/util';\nimport { mean, deviation, median, sum, max, min } from 'd3-array';\nimport { isUnset } from '../utils/helper';\nimport { column, columnOf } from './utils/helper';\nimport { createGroups } from './utils/order';\nfunction normalizeBasis(basis) {\n if (typeof basis === 'function')\n return basis;\n const registry = {\n min: (I, Y) => min(I, (i) => Y[+i]),\n max: (I, Y) => max(I, (i) => Y[+i]),\n first: (I, Y) => Y[I[0]],\n last: (I, Y) => Y[I[I.length - 1]],\n mean: (I, Y) => mean(I, (i) => Y[+i]),\n median: (I, Y) => median(I, (i) => Y[+i]),\n sum: (I, Y) => sum(I, (i) => Y[+i]),\n deviation: (I, Y) => deviation(I, (i) => Y[+i]),\n };\n return registry[basis] || max;\n}\n/**\n * Group marks into series by specified channels, and then transform\n * each series's value, say to transform them relative to some basis\n * to apply a moving average.\n */\nexport const NormalizeY = (options = {}) => {\n const { groupBy = 'x', basis = 'max' } = options;\n return (I, mark) => {\n const { encode, tooltip } = mark;\n const { x } = encode, rest = __rest(encode, [\"x\"]);\n // Extract and create new channels starts with y, such as y, y1.\n const Yn = Object.entries(rest)\n .filter(([k]) => k.startsWith('y'))\n .map(([k]) => [k, columnOf(encode, k)[0]]);\n const [, Y] = Yn.find(([k]) => k === 'y');\n const newYn = Yn.map(([k]) => [k, new Array(I.length)]);\n // Group marks into series by specified keys.\n const groups = createGroups(groupBy, I, mark);\n // Transform y channels for each group based on basis.\n const basisFunction = normalizeBasis(basis);\n for (const I of groups) {\n // Compute basis only base on y.\n const basisValue = basisFunction(I, Y);\n for (const i of I) {\n for (let j = 0; j < Yn.length; j++) {\n const [, V] = Yn[j];\n const [, newV] = newYn[j];\n newV[i] = +V[i] / basisValue;\n }\n }\n }\n const specifiedTooltip = isUnset(tooltip) || ((tooltip === null || tooltip === void 0 ? void 0 : tooltip.items) && (tooltip === null || tooltip === void 0 ? void 0 : tooltip.items.length) !== 0);\n return [\n I,\n deepMix({}, mark, Object.assign({ encode: Object.fromEntries(newYn.map(([k, v]) => [k, column(v, columnOf(encode, k)[1])])) }, (!specifiedTooltip &&\n encode.y0 && {\n tooltip: { items: [{ channel: 'y0' }] },\n }))),\n ];\n };\n};\nNormalizeY.props = {};\n//# sourceMappingURL=normalizeY.js.map","/**\n * 将多个单个参数的函数合成为一个函数,执行顺序为从右到左\n * @param fn 第一个函数\n * @param rest 剩余函数\n * @returns 复合后的函数\n */\nexport function compose(fn, ...rest) {\n return rest.reduce((pre, cur) => (x) => pre(cur(x)), fn);\n}\n//# sourceMappingURL=compose.js.map","/**\n * 返回一个 normalize 函数,该函数将输入的 t 从 [a, b] 线性变换到 [0, 1]\n * @param a 输入 t 的最小值\n * @param b 输入 t 的最大值\n * @returns normalize 函数\n */\nexport function createNormalize(a, b) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n return b - a ? (t) => (t - a) / (b - a) : (_) => 0.5;\n}\n//# sourceMappingURL=normalize.js.map","/**\n * 返回一个 clamp 函数,将输入限定在指定范围之内\n * @param a 范围的第一个端点\n * @param b 范围的第二个端点\n * @returns clamp 函数\n */\nexport function createClamp(a, b) {\n const lo = b < a ? b : a;\n const hi = a > b ? a : b;\n return (x) => Math.min(Math.max(lo, x), hi);\n}\n//# sourceMappingURL=clamp.js.map","/**\n * 在一个升序的序列指定范围内 array[lo, hi) 二分查找一个值 x,返回最右边一个匹配的值后面的索引 i\n * https://github.com/d3/d3-array/blob/master/src/bisector.js\n * @param array 升序的目标数组\n * @param x 查找的值\n * @param lo 开始的索引\n * @param hi 结束的索引\n * @returns 最右边一个匹配的值后一个的索引\n */\nexport function bisect(array, x, lo, hi, getter) {\n let i = lo || 0;\n let j = hi || array.length;\n const get = getter || ((x) => x);\n while (i < j) {\n const mid = Math.floor((i + j) / 2);\n if (get(array[mid]) > x) {\n j = mid;\n }\n else {\n i = mid + 1;\n }\n }\n return i;\n}\n//# sourceMappingURL=bisect.js.map","const e10 = Math.sqrt(50);\nconst e5 = Math.sqrt(10);\nconst e2 = Math.sqrt(2);\nexport function tickIncrement(start, stop, count) {\n const step = (stop - start) / Math.max(0, count);\n const power = Math.floor(Math.log(step) / Math.LN10);\n const error = step / 10 ** power;\n if (power >= 0) {\n // eslint-disable-next-line no-nested-ternary\n return (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * 10 ** power;\n }\n // eslint-disable-next-line no-nested-ternary\n return -(10 ** -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1);\n}\nexport function tickStep(start, stop, count) {\n const step0 = Math.abs(stop - start) / Math.max(0, count);\n let step1 = 10 ** Math.floor(Math.log(step0) / Math.LN10);\n const error = step0 / step1;\n if (error >= e10)\n step1 *= 10;\n else if (error >= e5)\n step1 *= 5;\n else if (error >= e2)\n step1 *= 2;\n return stop < start ? -step1 : step1;\n}\n//# sourceMappingURL=ticks.js.map","// 参考 d3-ticks nice 的实现\n// https://github.com/d3/d3-scale\nimport { tickIncrement } from './ticks';\nexport const d3LinearNice = (min, max, count = 5) => {\n const d = [min, max];\n let i0 = 0;\n let i1 = d.length - 1;\n let start = d[i0];\n let stop = d[i1];\n let step;\n if (stop < start) {\n [start, stop] = [stop, start];\n [i0, i1] = [i1, i0];\n }\n step = tickIncrement(start, stop, count);\n if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n step = tickIncrement(start, stop, count);\n }\n else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n step = tickIncrement(start, stop, count);\n }\n if (step > 0) {\n d[i0] = Math.floor(start / step) * step;\n d[i1] = Math.ceil(stop / step) * step;\n }\n else if (step < 0) {\n d[i0] = Math.ceil(start * step) / step;\n d[i1] = Math.floor(stop * step) / step;\n }\n return d;\n};\n//# sourceMappingURL=d3-linear-nice.js.map","export const DURATION_SECOND = 1000;\nexport const DURATION_MINUTE = DURATION_SECOND * 60;\nexport const DURATION_HOUR = DURATION_MINUTE * 60;\nexport const DURATION_DAY = DURATION_HOUR * 24;\nexport const DURATION_WEEK = DURATION_DAY * 7;\nexport const DURATION_MONTH = DURATION_DAY * 30;\nexport const DURATION_YEAR = DURATION_DAY * 365;\nexport function createInterval(duration, floorish, offseti, field) {\n const adjust = (date, step) => {\n const test = (date) => field(date) % step === 0;\n let i = step;\n while (i && !test(date)) {\n offseti(date, -1);\n i -= 1;\n }\n return date;\n };\n const floori = (date, step) => {\n if (step)\n adjust(date, step);\n floorish(date);\n };\n const floor = (date, step) => {\n const d = new Date(+date);\n floori(d, step);\n return d;\n };\n const ceil = (date, step) => {\n const d = new Date(+date - 1);\n floori(d, step);\n offseti(d, step);\n floori(d);\n return d;\n };\n const range = (start, stop, step, shouldAdjust) => {\n const ticks = [];\n const roundStep = Math.floor(step);\n const t = shouldAdjust ? ceil(start, step) : ceil(start);\n for (let i = t; i < stop; offseti(i, roundStep), floori(i)) {\n ticks.push(new Date(+i));\n }\n return ticks;\n };\n return {\n ceil,\n floor,\n range,\n duration,\n };\n}\nexport const millisecond = createInterval(1, (date) => date, (date, step = 1) => {\n date.setTime(+date + step);\n}, (date) => date.getTime());\nexport const second = createInterval(DURATION_SECOND, (date) => {\n date.setMilliseconds(0);\n}, (date, step = 1) => {\n date.setTime(+date + DURATION_SECOND * step);\n}, (date) => date.getSeconds());\nexport const minute = createInterval(DURATION_MINUTE, (date) => {\n date.setSeconds(0, 0);\n}, (date, step = 1) => {\n date.setTime(+date + DURATION_MINUTE * step);\n}, (date) => date.getMinutes());\nexport const hour = createInterval(DURATION_HOUR, (date) => {\n date.setMinutes(0, 0, 0);\n}, (date, step = 1) => {\n date.setTime(+date + DURATION_HOUR * step);\n}, (date) => date.getHours());\nexport const day = createInterval(DURATION_DAY, (date) => {\n date.setHours(0, 0, 0, 0);\n}, (date, step = 1) => {\n date.setTime(+date + DURATION_DAY * step);\n}, (date) => date.getDate() - 1);\nexport const month = createInterval(DURATION_MONTH, (date) => {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, (date, step = 1) => {\n const month = date.getMonth();\n date.setMonth(month + step);\n}, (date) => date.getMonth());\nexport const week = createInterval(DURATION_WEEK, (date) => {\n date.setDate(date.getDate() - (date.getDay() % 7));\n date.setHours(0, 0, 0, 0);\n}, (date, step = 1) => {\n date.setDate(date.getDate() + 7 * step);\n}, (date) => {\n const start = month.floor(date);\n const end = new Date(+date);\n return Math.floor((+end - +start) / DURATION_WEEK);\n});\nexport const year = createInterval(DURATION_YEAR, (date) => {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, (date, step = 1) => {\n const year = date.getFullYear();\n date.setFullYear(year + step);\n}, (date) => date.getFullYear());\nexport const localIntervalMap = {\n millisecond,\n second,\n minute,\n hour,\n day,\n week,\n month,\n year,\n};\n//# sourceMappingURL=time-interval.js.map","import { createInterval, DURATION_SECOND, DURATION_MINUTE, DURATION_HOUR, DURATION_DAY, DURATION_WEEK, DURATION_MONTH, DURATION_YEAR, } from './time-interval';\nexport const utcMillisecond = createInterval(1, (date) => date, (date, step = 1) => {\n date.setTime(+date + step);\n}, (date) => date.getTime());\nexport const utcSecond = createInterval(DURATION_SECOND, (date) => {\n date.setUTCMilliseconds(0);\n}, (date, step = 1) => {\n date.setTime(+date + DURATION_SECOND * step);\n}, (date) => date.getUTCSeconds());\nexport const utcMinute = createInterval(DURATION_MINUTE, (date) => {\n date.setUTCSeconds(0, 0);\n}, (date, step = 1) => {\n date.setTime(+date + DURATION_MINUTE * step);\n}, (date) => date.getUTCMinutes());\nexport const utcHour = createInterval(DURATION_HOUR, (date) => {\n date.setUTCMinutes(0, 0, 0);\n}, (date, step = 1) => {\n date.setTime(+date + DURATION_HOUR * step);\n}, (date) => date.getUTCHours());\nexport const utcDay = createInterval(DURATION_DAY, (date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step = 1) => {\n date.setTime(+date + DURATION_DAY * step);\n}, (date) => date.getUTCDate() - 1);\nexport const utcMonth = createInterval(DURATION_MONTH, (date) => {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step = 1) => {\n const month = date.getUTCMonth();\n date.setUTCMonth(month + step);\n}, (date) => date.getUTCMonth());\nexport const utcWeek = createInterval(DURATION_WEEK, (date) => {\n date.setUTCDate(date.getUTCDate() - ((date.getUTCDay() + 7) % 7));\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step = 1) => {\n date.setTime(+date + DURATION_WEEK * step);\n}, (date) => {\n const start = utcMonth.floor(date);\n const end = new Date(+date);\n return Math.floor((+end - +start) / DURATION_WEEK);\n});\nexport const utcYear = createInterval(DURATION_YEAR, (date) => {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step = 1) => {\n const year = date.getUTCFullYear();\n date.setUTCFullYear(year + step);\n}, (date) => date.getUTCFullYear());\nexport const utcIntervalMap = {\n millisecond: utcMillisecond,\n second: utcSecond,\n minute: utcMinute,\n hour: utcHour,\n day: utcDay,\n week: utcWeek,\n month: utcMonth,\n year: utcYear,\n};\n//# sourceMappingURL=utc-interval.js.map","import { localIntervalMap } from './time-interval';\nimport { utcIntervalMap } from './utc-interval';\nimport { bisect } from './bisect';\nimport { tickStep } from './ticks';\nfunction chooseTickIntervals(utc) {\n const intervalMap = utc ? utcIntervalMap : localIntervalMap;\n const { year, month, week, day, hour, minute, second, millisecond } = intervalMap;\n const tickIntervals = [\n [second, 1],\n [second, 5],\n [second, 15],\n [second, 30],\n [minute, 1],\n [minute, 5],\n [minute, 15],\n [minute, 30],\n [hour, 1],\n [hour, 3],\n [hour, 6],\n [hour, 12],\n [day, 1],\n [day, 2],\n [week, 1],\n [month, 1],\n [month, 3],\n [year, 1],\n ];\n return {\n tickIntervals,\n year,\n millisecond,\n };\n}\nexport function findTickInterval(start, stop, count, interval, utc) {\n const lo = +start;\n const hi = +stop;\n const { tickIntervals, year, millisecond } = chooseTickIntervals(utc);\n const getter = ([interval, count]) => interval.duration * count;\n const targetCount = interval ? (hi - lo) / interval : count || 5;\n const targetInterval = interval || (hi - lo) / targetCount;\n const len = tickIntervals.length;\n const i = bisect(tickIntervals, targetInterval, 0, len, getter);\n let matchInterval;\n if (i === len) {\n const step = tickStep(lo / year.duration, hi / year.duration, targetCount);\n matchInterval = [year, step];\n }\n else if (i) {\n const closeToLow = targetInterval / getter(tickIntervals[i - 1]) < getter(tickIntervals[i]) / targetInterval;\n const [timeInterval, targetStep] = closeToLow ? tickIntervals[i - 1] : tickIntervals[i];\n const step = interval ? Math.ceil(interval / timeInterval.duration) : targetStep;\n matchInterval = [timeInterval, step];\n }\n else {\n const step = Math.max(tickStep(lo, hi, targetCount), 1);\n matchInterval = [millisecond, step];\n }\n return matchInterval;\n}\n//# sourceMappingURL=find-tick-interval.js.map","import { findTickInterval } from './find-tick-interval';\nexport const d3TimeNice = (min, max, count, interval, utc) => {\n const r = min > max;\n const lo = r ? max : min;\n const hi = r ? min : max;\n const [tickInterval, step] = findTickInterval(lo, hi, count, interval, utc);\n const domain = [tickInterval.floor(lo, step), tickInterval.ceil(hi, step)];\n return r ? domain.reverse() : domain;\n};\n//# sourceMappingURL=d3-time-nice.js.map","var isArrayLike = function (value) {\n /**\n * isArrayLike([1, 2, 3]) => true\n * isArrayLike(document.body.children) => true\n * isArrayLike('abc') => true\n * isArrayLike(Function) => false\n */\n return value !== null && typeof value !== 'function' && isFinite(value.length);\n};\nexport default isArrayLike;\n//# sourceMappingURL=is-array-like.js.map","var toString = {}.toString;\nvar isType = function (value, type) { return toString.call(value) === '[object ' + type + ']'; };\nexport default isType;\n//# sourceMappingURL=is-type.js.map","/**\n * 是否为函数\n * @param {*} fn 对象\n * @return {Boolean} 是否函数\n */\nimport isType from './is-type';\nexport default (function (value) {\n return isType(value, 'Function');\n});\n//# sourceMappingURL=is-function.js.map","// isFinite,\nvar isNil = function (value) {\n /**\n * isNil(null) => true\n * isNil() => true\n */\n return value === null || value === undefined;\n};\nexport default isNil;\n//# sourceMappingURL=is-nil.js.map","import isType from './is-type';\nexport default (function (value) {\n return Array.isArray ?\n Array.isArray(value) :\n isType(value, 'Array');\n});\n//# sourceMappingURL=is-array.js.map","export default (function (value) {\n /**\n * isObject({}) => true\n * isObject([1, 2, 3]) => true\n * isObject(Function) => true\n * isObject(null) => false\n */\n var type = typeof value;\n return value !== null && type === 'object' || type === 'function';\n});\n//# sourceMappingURL=is-object.js.map","import isArray from './is-array';\nimport isObject from './is-object';\nfunction each(elements, func) {\n if (!elements) {\n return;\n }\n var rst;\n if (isArray(elements)) {\n for (var i = 0, len = elements.length; i < len; i++) {\n rst = func(elements[i], i);\n if (rst === false) {\n break;\n }\n }\n }\n else if (isObject(elements)) {\n for (var k in elements) {\n if (elements.hasOwnProperty(k)) {\n rst = func(elements[k], k);\n if (rst === false) {\n break;\n }\n }\n }\n }\n}\nexport default each;\n//# sourceMappingURL=each.js.map","var isObjectLike = function (value) {\n /**\n * isObjectLike({}) => true\n * isObjectLike([1, 2, 3]) => true\n * isObjectLike(Function) => false\n * isObjectLike(null) => false\n */\n return typeof value === 'object' && value !== null;\n};\nexport default isObjectLike;\n//# sourceMappingURL=is-object-like.js.map","import isObjectLike from './is-object-like';\nimport isType from './is-type';\nvar isPlainObject = function (value) {\n /**\n * isObjectLike(new Foo) => false\n * isObjectLike([1, 2, 3]) => false\n * isObjectLike({ x: 0, y: 0 }) => true\n * isObjectLike(Object.create(null)) => true\n */\n if (!isObjectLike(value) || !isType(value, 'Object')) {\n return false;\n }\n if (Object.getPrototypeOf(value) === null) {\n return true;\n }\n var proto = value;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(value) === proto;\n};\nexport default isPlainObject;\n//# sourceMappingURL=is-plain-object.js.map","import isType from './is-type';\nexport default (function (str) {\n return isType(str, 'String');\n});\n//# sourceMappingURL=is-string.js.map","/**\n * 判断是否数字\n * @return {Boolean} 是否数字\n */\nimport isType from './is-type';\nvar isNumber = function (value) {\n return isType(value, 'Number');\n};\nexport default isNumber;\n//# sourceMappingURL=is-number.js.map","import each from './each';\nimport isFunction from './is-function';\n// @ts-ignore\nvar values = Object.values ? function (obj) { return Object.values(obj); } : function (obj) {\n var result = [];\n each(obj, function (value, key) {\n if (!(isFunction(obj) && key === 'prototype')) {\n result.push(value);\n }\n });\n return result;\n};\nexport default values;\n//# sourceMappingURL=values.js.map","var isNull = function (value) {\n return value === null;\n};\nexport default isNull;\n//# sourceMappingURL=is-null.js.map","var isUndefined = function (value) {\n return value === undefined;\n};\nexport default isUndefined;\n//# sourceMappingURL=is-undefined.js.map","import isFunction from './is-function';\n/**\n * _.memoize(calColor);\n * _.memoize(calColor, (...args) => args[0]);\n * @param f\n * @param resolver\n */\nexport default (function (f, resolver) {\n if (!isFunction(f)) {\n throw new TypeError('Expected a function');\n }\n var memoized = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n // 使用方法构造 key,如果不存在 resolver,则直接取第一个参数作为 key\n var key = resolver ? resolver.apply(this, args) : args[0];\n var cache = memoized.cache;\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = f.apply(this, args);\n // 缓存起来\n cache.set(key, result);\n return result;\n };\n memoized.cache = new Map();\n return memoized;\n});\n//# sourceMappingURL=memoize.js.map","import isArray from './is-array';\nimport isPlainObject from './is-plain-object';\nvar MAX_MIX_LEVEL = 5;\nfunction _deepMix(dist, src, level, maxLevel) {\n level = level || 0;\n maxLevel = maxLevel || MAX_MIX_LEVEL;\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n var value = src[key];\n if (value !== null && isPlainObject(value)) {\n if (!isPlainObject(dist[key])) {\n dist[key] = {};\n }\n if (level < maxLevel) {\n _deepMix(dist[key], value, level + 1, maxLevel);\n }\n else {\n dist[key] = src[key];\n }\n }\n else if (isArray(value)) {\n dist[key] = [];\n dist[key] = dist[key].concat(value);\n }\n else if (value !== undefined) {\n dist[key] = value;\n }\n }\n }\n}\n// todo 重写\nvar deepMix = function (rst) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n for (var i = 0; i < args.length; i += 1) {\n _deepMix(rst, args[i]);\n }\n return rst;\n};\nexport default deepMix;\n//# sourceMappingURL=deep-mix.js.map","import isArrayLike from './is-array-like';\nvar indexOf = function (arr, obj) {\n if (!isArrayLike(arr)) {\n return -1;\n }\n var m = Array.prototype.indexOf;\n if (m) {\n return m.call(arr, obj);\n }\n var index = -1;\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] === obj) {\n index = i;\n break;\n }\n }\n return index;\n};\nexport default indexOf;\n//# sourceMappingURL=index-of.js.map","export default (function (v) { return v; });\n//# sourceMappingURL=identity.js.map","import isNil from './is-nil';\nimport isArraylike from './is-array-like';\nexport default function size(o) {\n if (isNil(o)) {\n return 0;\n }\n if (isArraylike(o)) {\n return o.length;\n }\n return Object.keys(o).length;\n}\n//# sourceMappingURL=size.js.map","import { __spreadArrays } from \"tslib\";\nimport values from './values';\nimport memoize from './memoize';\nimport isString from './is-string';\nvar ctx;\n/**\n * 计算文本的宽度\n */\nexport default memoize(function (text, font) {\n if (font === void 0) { font = {}; }\n var fontSize = font.fontSize, fontFamily = font.fontFamily, fontWeight = font.fontWeight, fontStyle = font.fontStyle, fontVariant = font.fontVariant;\n if (!ctx) {\n ctx = document.createElement('canvas').getContext('2d');\n }\n ctx.font = [fontStyle, fontVariant, fontWeight, fontSize + \"px\", fontFamily].join(' ');\n return ctx.measureText(isString(text) ? text : '').width;\n}, function (text, font) {\n if (font === void 0) { font = {}; }\n return __spreadArrays([text], values(font)).join('');\n});\n//# sourceMappingURL=measure-text-width.js.map","import { isNull, isUndefined } from '@antv/util';\nexport function isValid(x) {\n return !isUndefined(x) && !isNull(x) && !Number.isNaN(x);\n}\n//# sourceMappingURL=is-valid.js.map","const reflect = (f) => {\n return (x) => -f(-x);\n};\nexport const logs = (base, shouldReflect) => {\n const baseCache = Math.log(base);\n const log = base === Math.E\n ? Math.log\n : base === 10\n ? Math.log10\n : base === 2\n ? Math.log2\n : (x) => Math.log(x) / baseCache;\n return shouldReflect ? reflect(log) : log;\n};\nexport const pows = (base, shouldReflect) => {\n const pow = base === Math.E ? Math.exp : (x) => base ** x;\n return shouldReflect ? reflect(pow) : pow;\n};\n//# sourceMappingURL=log.js.map","import { logs, pows } from './log';\nexport const d3LogNice = (a, b, _, base) => {\n const shouldReflect = a < 0;\n const log = logs(base, shouldReflect);\n const pow = pows(base, shouldReflect);\n const r = a > b;\n const min = r ? b : a;\n const max = r ? a : b;\n const niceDomain = [pow(Math.floor(log(min))), pow(Math.ceil(log(max)))];\n return r ? niceDomain.reverse() : niceDomain;\n};\n//# sourceMappingURL=d3-log-nice.js.map","import { isNumber } from '@antv/util';\nimport { compose } from './compose';\nconst createInterpolatorRound = (interpolator) => {\n return (t) => {\n // If result is not number, it can't be rounded.\n const res = interpolator(t);\n return isNumber(res) ? Math.round(res) : res;\n };\n};\nexport function interpolatize(rangeOf, normalizeDomain) {\n return (Scale) => {\n Scale.prototype.rescale = function () {\n this.initRange();\n this.nice();\n const [transform] = this.chooseTransforms();\n this.composeOutput(transform, this.chooseClamp(transform));\n };\n Scale.prototype.initRange = function () {\n const { interpolator } = this.options;\n this.options.range = rangeOf(interpolator);\n };\n Scale.prototype.composeOutput = function (transform, clamp) {\n const { domain, interpolator, round } = this.getOptions();\n const normalize = normalizeDomain(domain.map(transform));\n const interpolate = round ? createInterpolatorRound(interpolator) : interpolator;\n this.output = compose(interpolate, normalize, clamp, transform);\n };\n Scale.prototype.invert = undefined;\n };\n}\n//# sourceMappingURL=interpolatize.js.map","'use strict'\r\n\r\nmodule.exports = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\r\n","module.exports = function isArrayish(obj) {\n\tif (!obj || typeof obj === 'string') {\n\t\treturn false;\n\t}\n\n\treturn obj instanceof Array || Array.isArray(obj) ||\n\t\t(obj.length >= 0 && (obj.splice instanceof Function ||\n\t\t\t(Object.getOwnPropertyDescriptor(obj, (obj.length - 1)) && obj.constructor.name !== 'String')));\n};\n","'use strict';\n\nvar isArrayish = require('is-arrayish');\n\nvar concat = Array.prototype.concat;\nvar slice = Array.prototype.slice;\n\nvar swizzle = module.exports = function swizzle(args) {\n\tvar results = [];\n\n\tfor (var i = 0, len = args.length; i < len; i++) {\n\t\tvar arg = args[i];\n\n\t\tif (isArrayish(arg)) {\n\t\t\t// http://jsperf.com/javascript-array-concat-vs-push/98\n\t\t\tresults = concat.call(results, slice.call(arg));\n\t\t} else {\n\t\t\tresults.push(arg);\n\t\t}\n\t}\n\n\treturn results;\n};\n\nswizzle.wrap = function (fn) {\n\treturn function () {\n\t\treturn fn(swizzle(arguments));\n\t};\n};\n","/* MIT license */\nvar colorNames = require('color-name');\nvar swizzle = require('simple-swizzle');\nvar hasOwnProperty = Object.hasOwnProperty;\n\nvar reverseNames = Object.create(null);\n\n// create a list of reverse color names\nfor (var name in colorNames) {\n\tif (hasOwnProperty.call(colorNames, name)) {\n\t\treverseNames[colorNames[name]] = name;\n\t}\n}\n\nvar cs = module.exports = {\n\tto: {},\n\tget: {}\n};\n\ncs.get = function (string) {\n\tvar prefix = string.substring(0, 3).toLowerCase();\n\tvar val;\n\tvar model;\n\tswitch (prefix) {\n\t\tcase 'hsl':\n\t\t\tval = cs.get.hsl(string);\n\t\t\tmodel = 'hsl';\n\t\t\tbreak;\n\t\tcase 'hwb':\n\t\t\tval = cs.get.hwb(string);\n\t\t\tmodel = 'hwb';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tval = cs.get.rgb(string);\n\t\t\tmodel = 'rgb';\n\t\t\tbreak;\n\t}\n\n\tif (!val) {\n\t\treturn null;\n\t}\n\n\treturn {model: model, value: val};\n};\n\ncs.get.rgb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar abbr = /^#([a-f0-9]{3,4})$/i;\n\tvar hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;\n\tvar rgba = /^rgba?\\(\\s*([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/;\n\tvar per = /^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/;\n\tvar keyword = /^(\\w+)$/;\n\n\tvar rgb = [0, 0, 0, 1];\n\tvar match;\n\tvar i;\n\tvar hexAlpha;\n\n\tif (match = string.match(hex)) {\n\t\thexAlpha = match[2];\n\t\tmatch = match[1];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\t// https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19\n\t\t\tvar i2 = i * 2;\n\t\t\trgb[i] = parseInt(match.slice(i2, i2 + 2), 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = parseInt(hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(abbr)) {\n\t\tmatch = match[1];\n\t\thexAlpha = match[3];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = parseInt(match[i] + match[i], 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(rgba)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = parseInt(match[i + 1], 0);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\tif (match[5]) {\n\t\t\t\trgb[3] = parseFloat(match[4]) * 0.01;\n\t\t\t} else {\n\t\t\t\trgb[3] = parseFloat(match[4]);\n\t\t\t}\n\t\t}\n\t} else if (match = string.match(per)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\tif (match[5]) {\n\t\t\t\trgb[3] = parseFloat(match[4]) * 0.01;\n\t\t\t} else {\n\t\t\t\trgb[3] = parseFloat(match[4]);\n\t\t\t}\n\t\t}\n\t} else if (match = string.match(keyword)) {\n\t\tif (match[1] === 'transparent') {\n\t\t\treturn [0, 0, 0, 0];\n\t\t}\n\n\t\tif (!hasOwnProperty.call(colorNames, match[1])) {\n\t\t\treturn null;\n\t\t}\n\n\t\trgb = colorNames[match[1]];\n\t\trgb[3] = 1;\n\n\t\treturn rgb;\n\t} else {\n\t\treturn null;\n\t}\n\n\tfor (i = 0; i < 3; i++) {\n\t\trgb[i] = clamp(rgb[i], 0, 255);\n\t}\n\trgb[3] = clamp(rgb[3], 0, 1);\n\n\treturn rgb;\n};\n\ncs.get.hsl = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar hsl = /^hsla?\\(\\s*([+-]?(?:\\d{0,3}\\.)?\\d+)(?:deg)?\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*(?:[,|\\/]\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/;\n\tvar match = string.match(hsl);\n\n\tif (match) {\n\t\tvar alpha = parseFloat(match[4]);\n\t\tvar h = ((parseFloat(match[1]) % 360) + 360) % 360;\n\t\tvar s = clamp(parseFloat(match[2]), 0, 100);\n\t\tvar l = clamp(parseFloat(match[3]), 0, 100);\n\t\tvar a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);\n\n\t\treturn [h, s, l, a];\n\t}\n\n\treturn null;\n};\n\ncs.get.hwb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar hwb = /^hwb\\(\\s*([+-]?\\d{0,3}(?:\\.\\d+)?)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/;\n\tvar match = string.match(hwb);\n\n\tif (match) {\n\t\tvar alpha = parseFloat(match[4]);\n\t\tvar h = ((parseFloat(match[1]) % 360) + 360) % 360;\n\t\tvar w = clamp(parseFloat(match[2]), 0, 100);\n\t\tvar b = clamp(parseFloat(match[3]), 0, 100);\n\t\tvar a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);\n\t\treturn [h, w, b, a];\n\t}\n\n\treturn null;\n};\n\ncs.to.hex = function () {\n\tvar rgba = swizzle(arguments);\n\n\treturn (\n\t\t'#' +\n\t\thexDouble(rgba[0]) +\n\t\thexDouble(rgba[1]) +\n\t\thexDouble(rgba[2]) +\n\t\t(rgba[3] < 1\n\t\t\t? (hexDouble(Math.round(rgba[3] * 255)))\n\t\t\t: '')\n\t);\n};\n\ncs.to.rgb = function () {\n\tvar rgba = swizzle(arguments);\n\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')'\n\t\t: 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';\n};\n\ncs.to.rgb.percent = function () {\n\tvar rgba = swizzle(arguments);\n\n\tvar r = Math.round(rgba[0] / 255 * 100);\n\tvar g = Math.round(rgba[1] / 255 * 100);\n\tvar b = Math.round(rgba[2] / 255 * 100);\n\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)'\n\t\t: 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';\n};\n\ncs.to.hsl = function () {\n\tvar hsla = swizzle(arguments);\n\treturn hsla.length < 4 || hsla[3] === 1\n\t\t? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)'\n\t\t: 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';\n};\n\n// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax\n// (hwb have alpha optional & 1 is default value)\ncs.to.hwb = function () {\n\tvar hwba = swizzle(arguments);\n\n\tvar a = '';\n\tif (hwba.length >= 4 && hwba[3] !== 1) {\n\t\ta = ', ' + hwba[3];\n\t}\n\n\treturn 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';\n};\n\ncs.to.keyword = function (rgb) {\n\treturn reverseNames[rgb.slice(0, 3)];\n};\n\n// helpers\nfunction clamp(num, min, max) {\n\treturn Math.min(Math.max(min, num), max);\n}\n\nfunction hexDouble(num) {\n\tvar str = Math.round(num).toString(16).toUpperCase();\n\treturn (str.length < 2) ? '0' + str : str;\n}\n","import colorString from 'color-string';\nfunction hue2rgb(p, q, m) {\n let t = m;\n if (t < 0)\n t += 1;\n if (t > 1)\n t -= 1;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\nfunction hsl2rbg(hsl) {\n const h = hsl[0] / 360;\n const s = hsl[1] / 100;\n const l = hsl[2] / 100;\n const a = hsl[3];\n if (s === 0)\n return [l * 255, l * 255, l * 255, a];\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n const r = hue2rgb(p, q, h + 1 / 3);\n const g = hue2rgb(p, q, h);\n const b = hue2rgb(p, q, h - 1 / 3);\n return [r * 255, g * 255, b * 255, a];\n}\nexport function string2rbg(s) {\n const color = colorString.get(s);\n if (!color)\n return null;\n const { model, value } = color;\n if (model === 'rgb')\n return value;\n if (model === 'hsl')\n return hsl2rbg(value);\n return null;\n}\n//# sourceMappingURL=color.js.map","import { string2rbg } from './color';\n/**\n * 返回一个线性插值器,接受数字\n * @param a 任意值\n * @param b 任意值\n * @returns 线性插值器\n */\nexport const createInterpolateNumber = (a, b) => {\n return (t) => a * (1 - t) + b * t;\n};\nexport const createInterpolateColor = (a, b) => {\n const c1 = string2rbg(a);\n const c2 = string2rbg(b);\n if (c1 === null || c2 === null)\n return c1 ? () => a : () => b;\n return (t) => {\n const values = new Array(4);\n for (let i = 0; i < 4; i += 1) {\n const from = c1[i];\n const to = c2[i];\n values[i] = from * (1 - t) + to * t;\n }\n const [r, g, b, a] = values;\n return `rgba(${Math.round(r)}, ${Math.round(g)}, ${Math.round(b)}, ${a})`;\n };\n};\n/**\n * 返回一个线性插值器,接受数字和颜色\n * @param a 任意值\n * @param b 任意值\n * @returns 线性插值器\n */\nexport const createInterpolateValue = (a, b) => {\n if (typeof a === 'number' && typeof b === 'number')\n return createInterpolateNumber(a, b);\n if (typeof a === 'string' && typeof b === 'string')\n return createInterpolateColor(a, b);\n return () => a;\n};\n/**\n * 返回一个 round 线性差值器,对输出值进行四舍五入\n * @param a 任意值\n * @param b 任意值\n * @returns 线性插值器\n */\nexport const createInterpolateRound = (a, b) => {\n const interpolateNumber = createInterpolateNumber(a, b);\n return (t) => Math.round(interpolateNumber(t));\n};\n//# sourceMappingURL=interpolate.js.map","export function chooseNiceTimeMask(date, intervalMap) {\n const { second, minute, hour, day, week, month, year } = intervalMap;\n if (second.floor(date) < date)\n return '.SSS';\n if (minute.floor(date) < date)\n return ':ss';\n if (hour.floor(date) < date)\n return 'hh:mm';\n if (day.floor(date) < date)\n return 'hh A';\n if (month.floor(date) < date) {\n if (week.floor(date) < date)\n return 'MMM DD';\n return 'ddd DD';\n }\n if (year.floor(date) < date)\n return 'MMMM';\n return 'YYYY';\n}\n//# sourceMappingURL=choose-mask.js.map","function internGet({ map, initKey }, value) {\n const key = initKey(value);\n return map.has(key) ? map.get(key) : value;\n}\nfunction internSet({ map, initKey }, value) {\n const key = initKey(value);\n if (map.has(key))\n return map.get(key);\n map.set(key, value);\n return value;\n}\nfunction internDelete({ map, initKey }, value) {\n const key = initKey(value);\n if (map.has(key)) {\n value = map.get(key);\n map.delete(key);\n }\n return value;\n}\nfunction keyof(value) {\n return typeof value === 'object' ? value.valueOf() : value;\n}\n/**\n * @see 参考 https://github.com/mbostock/internmap/blob/main/src/index.js\n */\nexport class InternMap extends Map {\n constructor(entries) {\n super();\n this.map = new Map();\n this.initKey = keyof;\n if (entries !== null) {\n for (const [key, value] of entries) {\n this.set(key, value);\n }\n }\n }\n get(key) {\n return super.get(internGet({ map: this.map, initKey: this.initKey }, key));\n }\n has(key) {\n return super.has(internGet({ map: this.map, initKey: this.initKey }, key));\n }\n set(key, value) {\n return super.set(internSet({ map: this.map, initKey: this.initKey }, key), value);\n }\n delete(key) {\n return super.delete(internDelete({ map: this.map, initKey: this.initKey }, key));\n }\n}\n//# sourceMappingURL=internMap.js.map","import { deepMix } from '@antv/util';\nexport class Base {\n /**\n * 构造函数,根据自定义的选项和默认选项生成当前选项\n * @param options 需要自定义配置的选项\n */\n constructor(options) {\n this.options = deepMix({}, this.getDefaultOptions());\n this.update(options);\n }\n /**\n * 返回当前的所有选项\n * @returns 当前的所有选项\n */\n getOptions() {\n return this.options;\n }\n /**\n * 更新选项和比例尺的内部状态\n * @param updateOptions 需要更新的选项\n */\n update(updateOptions = {}) {\n this.options = deepMix({}, this.options, updateOptions);\n this.rescale(updateOptions);\n }\n /**\n * 根据需要更新 options 和更新后的 options 更新 scale 的内部状态,\n * 在函数内部可以用 this.options 获得更新后的 options\n * @param options 需要更新的 options\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n rescale(options) { }\n}\n//# sourceMappingURL=base.js.map","import { Base } from './base';\nexport const defaultUnknown = Symbol('defaultUnknown');\n/**\n * 更新 indexMap\n *\n * @param arr 初始的数组\n * @param target 目标 map\n * @returns {Map} 生成的 indexMap\n */\nfunction updateIndexMap(target, arr, key) {\n for (let i = 0; i < arr.length; i += 1) {\n if (!target.has(arr[i])) {\n target.set(key(arr[i]), i);\n }\n }\n}\n/**\n * 基于 indexMap 进行映射\n *\n * @param options 相关选项\n * @see MapBetweenArrOptions\n * @return {any} 映射结果\n */\nfunction mapBetweenArrByMapIndex(options) {\n const { value, from, to, mapper, notFoundReturn } = options;\n let mappedIndex = mapper.get(value);\n // index 不存在时,\n // 如果用户显式设置了 unknown 的值,那么就返回 unknown 的值\n // 否者我们将 value 添加到原数组, 并更新 Map\n if (mappedIndex === undefined) {\n if (notFoundReturn !== defaultUnknown) {\n return notFoundReturn;\n }\n mappedIndex = from.push(value) - 1;\n mapper.set(value, mappedIndex);\n }\n return to[mappedIndex % to.length];\n}\nfunction createKey(d) {\n if (d instanceof Date)\n return (d) => `${d}`;\n if (typeof d === 'object')\n return (d) => JSON.stringify(d);\n return (d) => d;\n}\n/**\n * Ordinal 比例尺\n *\n * 该比例尺具有离散的域和范围,例如将一组命名类别映射到一组颜色\n *\n * - 使用 for 替代一些基于 map 的遍历,for 循环性能远高于 forEach, map\n * - 阻止无意义的更新,只有到用户调用 map、invert 或者 update 之后才会进行相应的更新\n * - 两个 map 只初始化一次,在之后的更新中复用他们,这样我们避免了重复 new Map 带来的性能问题\n * 在大量调用 update 函数场景下,较 d3-scale 效率有质的提高\n */\nexport class Ordinal extends Base {\n // 覆盖默认配置\n getDefaultOptions() {\n return {\n domain: [],\n range: [],\n unknown: defaultUnknown,\n };\n }\n // 显示指定 options 的类型为 OrdinalOptions,从而推断出 O 的类型\n constructor(options) {\n super(options);\n }\n map(x) {\n if (this.domainIndexMap.size === 0) {\n updateIndexMap(this.domainIndexMap, this.getDomain(), this.domainKey);\n }\n return mapBetweenArrByMapIndex({\n value: this.domainKey(x),\n mapper: this.domainIndexMap,\n from: this.getDomain(),\n to: this.getRange(),\n notFoundReturn: this.options.unknown,\n });\n }\n invert(y) {\n if (this.rangeIndexMap.size === 0) {\n updateIndexMap(this.rangeIndexMap, this.getRange(), this.rangeKey);\n }\n return mapBetweenArrByMapIndex({\n value: this.rangeKey(y),\n mapper: this.rangeIndexMap,\n from: this.getRange(),\n to: this.getDomain(),\n notFoundReturn: this.options.unknown,\n });\n }\n // 因为 ordinal 比例尺更新内部状态的开销较大,所以按需更新\n rescale(options) {\n const [d] = this.options.domain;\n const [r] = this.options.range;\n this.domainKey = createKey(d);\n this.rangeKey = createKey(r);\n // 如果 rangeIndexMap 没有初始化,说明是在初始化阶段\n if (!this.rangeIndexMap) {\n this.rangeIndexMap = new Map();\n this.domainIndexMap = new Map();\n return;\n }\n // 否者是在更新阶段\n if (!options || options.range) {\n this.rangeIndexMap.clear();\n }\n if (!options || options.domain || options.compare) {\n this.domainIndexMap.clear();\n this.sortedDomain = undefined;\n }\n }\n clone() {\n return new Ordinal(this.options);\n }\n getRange() {\n return this.options.range;\n }\n getDomain() {\n // 如果设置了比较器,就排序\n if (this.sortedDomain)\n return this.sortedDomain;\n const { domain, compare } = this.options;\n this.sortedDomain = compare ? [...domain].sort(compare) : domain;\n return this.sortedDomain;\n }\n}\n//# sourceMappingURL=ordinal.js.map","import { InternMap } from '../utils';\nimport { Ordinal, defaultUnknown } from './ordinal';\nfunction normalize(array) {\n const min = Math.min(...array);\n return array.map((d) => d / min);\n}\nfunction splice(array, n) {\n const sn = array.length;\n const diff = n - sn;\n return diff > 0 ? [...array, ...new Array(diff).fill(1)] : diff < 0 ? array.slice(0, n) : array;\n}\nfunction pretty(n) {\n return Math.round(n * 1e12) / 1e12;\n}\n/**\n * 基于 band 基础配置获取存在 flex band 的状态\n */\nfunction computeFlexBandState(options) {\n // 如果 flex 比 domain 少,那么就补全\n // 如果 flex 比 domain 多,就截取\n const { domain, range, paddingOuter, paddingInner, flex: F, round, align } = options;\n const n = domain.length;\n const flex = splice(F, n);\n // 根据下面的等式可以计算出所有 step 的总和\n // stepSum = step1 + step2 ... + stepN;\n // stepAverage = stepSum / n;\n // PO = stepAverage * paddingOuter;\n // PI = stepAverage * paddingInner;\n // width = PO * 2 + stepSum - PI;\n const [start, end] = range;\n const width = end - start;\n const ratio = (2 / n) * paddingOuter + 1 - (1 / n) * paddingInner;\n const stepSum = width / ratio;\n // stepSum = (b1 + PI) + (b2 + PI) ... + (bN + PI)\n // = bandSum + PI * n;\n const PI = (stepSum * paddingInner) / n;\n const bandWidthSum = stepSum - n * PI;\n // 计算出最小的 bandWidth\n const normalizedFlex = normalize(flex);\n const flexSum = normalizedFlex.reduce((sum, value) => sum + value);\n const minBandWidth = bandWidthSum / flexSum;\n // 计算每个 bandWidth 和 step,并且用定义域内的值索引\n const valueBandWidth = new InternMap(domain.map((d, i) => {\n const bandWidth = normalizedFlex[i] * minBandWidth;\n return [d, round ? Math.floor(bandWidth) : bandWidth];\n }));\n const valueStep = new InternMap(domain.map((d, i) => {\n const bandWidth = normalizedFlex[i] * minBandWidth;\n const step = bandWidth + PI;\n return [d, round ? Math.floor(step) : step];\n }));\n // 计算起始位置的偏移量\n // 因为 step 可能被 round 了,重新计算所有的 step 的总和\n const finalStepSum = Array.from(valueStep.values()).reduce((sum, value) => sum + value);\n const outerPaddingSum = width - (finalStepSum - (finalStepSum / n) * paddingInner);\n const offset = outerPaddingSum * align;\n // 计算 adjustedRange,也就是 domain 中每个值映射之后的值\n const bandStart = start + offset;\n let prev = round ? Math.round(bandStart) : bandStart;\n const adjustedRange = new Array(n);\n for (let i = 0; i < n; i += 1) {\n // 简单处理精度问题\n adjustedRange[i] = pretty(prev);\n const value = domain[i];\n prev += valueStep.get(value);\n }\n return {\n valueBandWidth,\n valueStep,\n adjustedRange,\n };\n}\n/**\n * 基于 band 基础配置获取 band 的状态\n */\nfunction computeBandState(options) {\n var _a;\n const { domain } = options;\n const n = domain.length;\n if (n === 0) {\n return {\n valueBandWidth: undefined,\n valueStep: undefined,\n adjustedRange: [],\n };\n }\n const hasFlex = !!((_a = options.flex) === null || _a === void 0 ? void 0 : _a.length);\n if (hasFlex) {\n return computeFlexBandState(options);\n }\n const { range, paddingOuter, paddingInner, round, align } = options;\n let step;\n let bandWidth;\n let rangeStart = range[0];\n const rangeEnd = range[1];\n // range 的计算方式如下:\n // = stop - start\n // = (n * step(n 个 step) )\n // + (2 * step * paddingOuter(两边的 padding))\n // - (1 * step * paddingInner(多出的一个 inner))\n const deltaRange = rangeEnd - rangeStart;\n const outerTotal = paddingOuter * 2;\n const innerTotal = n - paddingInner;\n step = deltaRange / Math.max(1, outerTotal + innerTotal);\n // 优化成整数\n if (round) {\n step = Math.floor(step);\n }\n // 基于 align 实现偏移\n rangeStart += (deltaRange - step * (n - paddingInner)) * align;\n // 一个 step 的组成如下:\n // step = bandWidth + step * paddingInner,\n // 则 bandWidth = step - step * (paddingInner)\n bandWidth = step * (1 - paddingInner);\n if (round) {\n rangeStart = Math.round(rangeStart);\n bandWidth = Math.round(bandWidth);\n }\n // 转化后的 range\n const adjustedRange = new Array(n).fill(0).map((_, i) => rangeStart + i * step);\n return {\n valueStep: step,\n valueBandWidth: bandWidth,\n adjustedRange,\n };\n}\n/**\n * Band 比例尺\n *\n * 一种特殊的 ordinal scale,区别在于值域的范围是连续的。\n * 使用的场景例如柱状图,可以用来定位各个柱子水平方向距离原点开始绘制的距离、各柱子之间的间距\n *\n * 由于部分选项较为抽象,见下图描述:\n *\n * BN = bandWidthN\n * SN = stepN\n * domain = [A, B]\n *\n * 约束关系如下\n * width = PO + B1 + PI + B2 + PI ... + BN + PO;\n * PO = (S1 + S2 + ... SN) / N * paddingOuter\n * PI = (S1 + S2 + ... SN) / N * paddingInner\n * BN / BN-1 = flex[n] / flex[n-1]\n *\n * |<------------------------------------------- range ------------------------------------------->|\n * | | | | | | |\n * |<-----PO---->|<------B1--------->|<-----PI---->|<-------B2-------->|<----PI----->|<-----PO---->|\n * | | ***************** | | ***************** | | |\n * | | ******* A ******* | | ******* B ******* | | |\n * | | ***************** | | ***************** | | |\n * | |<--------------S1--------------->| <--------------S2-------------->| |\n * |-----------------------------------------------------------------------------------------------|\n *\n */\nexport class Band extends Ordinal {\n // 覆盖默认配置\n getDefaultOptions() {\n return {\n domain: [],\n range: [0, 1],\n align: 0.5,\n round: false,\n paddingInner: 0,\n paddingOuter: 0,\n padding: 0,\n unknown: defaultUnknown,\n flex: [],\n };\n }\n // 显示指定 options 的类型为 OrdinalOptions,从而推断出 O 的类型\n constructor(options) {\n super(options);\n }\n clone() {\n return new Band(this.options);\n }\n getStep(x) {\n if (this.valueStep === undefined)\n return 1;\n // 没有 flex 的情况时, valueStep 是 number 类型\n if (typeof this.valueStep === 'number') {\n return this.valueStep;\n }\n // 对于 flex 都为 1 的情况,x 不是必须要传入的\n // 这种情况所有的条的 step 都相等,所以返回第一个就好\n if (x === undefined)\n return Array.from(this.valueStep.values())[0];\n return this.valueStep.get(x);\n }\n getBandWidth(x) {\n if (this.valueBandWidth === undefined)\n return 1;\n // 没有 flex, valueBandWidth 是 number 类型\n if (typeof this.valueBandWidth === 'number') {\n return this.valueBandWidth;\n }\n // 对于 flex 都为 1 的情况,x 不是必须要传入的\n // 这种情况所有的条的 bandWidth 都相等,所以返回第一个\n if (x === undefined)\n return Array.from(this.valueBandWidth.values())[0];\n return this.valueBandWidth.get(x);\n }\n getRange() {\n return this.adjustedRange;\n }\n getPaddingInner() {\n const { padding, paddingInner } = this.options;\n return padding > 0 ? padding : paddingInner;\n }\n getPaddingOuter() {\n const { padding, paddingOuter } = this.options;\n return padding > 0 ? padding : paddingOuter;\n }\n rescale() {\n super.rescale();\n // 当用户配置了opt.padding 且非 0 时,我们覆盖已经设置的 paddingInner paddingOuter\n // 我们约定 padding 的优先级较 paddingInner 和 paddingOuter 高\n const { align, domain, range, round, flex } = this.options;\n const { adjustedRange, valueBandWidth, valueStep } = computeBandState({\n align,\n range,\n round,\n flex,\n paddingInner: this.getPaddingInner(),\n paddingOuter: this.getPaddingOuter(),\n domain,\n });\n // 更新必要的属性\n this.valueStep = valueStep;\n this.valueBandWidth = valueBandWidth;\n this.adjustedRange = adjustedRange;\n }\n}\n//# sourceMappingURL=band.js.map","import { tickIncrement } from '../utils';\nexport const d3Ticks = (begin, end, count) => {\n let n;\n let ticks;\n let start = begin;\n let stop = end;\n if (start === stop && count > 0) {\n return [start];\n }\n let step = tickIncrement(start, stop, count);\n if (step === 0 || !Number.isFinite(step)) {\n return [];\n }\n if (step > 0) {\n start = Math.ceil(start / step);\n stop = Math.floor(stop / step);\n ticks = new Array((n = Math.ceil(stop - start + 1)));\n for (let i = 0; i < n; i += 1) {\n ticks[i] = (start + i) * step;\n }\n }\n else {\n step = -step;\n start = Math.ceil(start * step);\n stop = Math.floor(stop * step);\n ticks = new Array((n = Math.ceil(stop - start + 1)));\n for (let i = 0; i < n; i += 1) {\n ticks[i] = (start + i) / step;\n }\n }\n return ticks;\n};\n//# sourceMappingURL=d3-ticks.js.map","import { isNumber } from '@antv/util';\nimport { d3Ticks } from '../tick-methods/d3-ticks';\nimport { Base } from './base';\nexport class Constant extends Base {\n /**\n * 返回需要覆盖的默认选项\n * @returns 需要覆盖的默认选项\n */\n getDefaultOptions() {\n return {\n range: [0],\n domain: [0, 1],\n unknown: undefined,\n tickCount: 5,\n tickMethod: d3Ticks,\n };\n }\n /**\n * 输入和输出满足:y = b,其中 b 是一个常量,是 options.range 的第一个元素\n * @param _ 输入值\n * @returns 输出值(常量)\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n map(_) {\n const [v] = this.options.range;\n return v !== undefined ? v : this.options.unknown;\n }\n /**\n * 如果 x 是该比例尺的常量(\bx === b),返回输入值的范围(即定义域),否者返回 []\n * @param x 输出值 (常量)\n * @returns 定义域\n */\n invert(x) {\n const [v] = this.options.range;\n return x === v && v !== undefined ? this.options.domain : [];\n }\n getTicks() {\n const { tickMethod, domain, tickCount } = this.options;\n const [a, b] = domain;\n if (!isNumber(a) || !isNumber(b))\n return [];\n return tickMethod(a, b, tickCount);\n }\n /**\n * 克隆 Constant Scale\n * @returns 拥有相同选项且独立的 Constant Scale\n */\n clone() {\n return new Constant(this.options);\n }\n}\n//# sourceMappingURL=constant.js.map","// 为了解决 js 运算的精度问题\nexport function prettyNumber(n) {\n return Math.abs(n) < 1e-14 ? n : parseFloat(n.toFixed(14));\n}\n//# sourceMappingURL=pretty-number.js.map","import { indexOf, size } from '@antv/util';\nimport { prettyNumber } from '../utils/pretty-number';\nexport const DEFAULT_Q = [1, 5, 2, 2.5, 4, 3];\nexport const ALL_Q = [1, 5, 2, 2.5, 4, 3, 1.5, 7, 6, 8, 9];\nconst eps = Number.EPSILON * 100;\nfunction mod(n, m) {\n return ((n % m) + m) % m;\n}\nfunction round(n) {\n return Math.round(n * 1e12) / 1e12;\n}\nfunction simplicity(q, Q, j, lmin, lmax, lstep) {\n const n = size(Q);\n const i = indexOf(Q, q);\n let v = 0;\n const m = mod(lmin, lstep);\n if ((m < eps || lstep - m < eps) && lmin <= 0 && lmax >= 0) {\n v = 1;\n }\n return 1 - i / (n - 1) - j + v;\n}\nfunction simplicityMax(q, Q, j) {\n const n = size(Q);\n const i = indexOf(Q, q);\n const v = 1;\n return 1 - i / (n - 1) - j + v;\n}\nfunction density(k, m, dMin, dMax, lMin, lMax) {\n const r = (k - 1) / (lMax - lMin);\n const rt = (m - 1) / (Math.max(lMax, dMax) - Math.min(dMin, lMin));\n return 2 - Math.max(r / rt, rt / r);\n}\nfunction densityMax(k, m) {\n if (k >= m) {\n return 2 - (k - 1) / (m - 1);\n }\n return 1;\n}\nfunction coverage(dMin, dMax, lMin, lMax) {\n const range = dMax - dMin;\n return 1 - (0.5 * ((dMax - lMax) ** 2 + (dMin - lMin) ** 2)) / (0.1 * range) ** 2;\n}\nfunction coverageMax(dMin, dMax, span) {\n const range = dMax - dMin;\n if (span > range) {\n const half = (span - range) / 2;\n return 1 - half ** 2 / (0.1 * range) ** 2;\n }\n return 1;\n}\nfunction legibility() {\n return 1;\n}\n/**\n * An Extension of Wilkinson's Algorithm for Position Tick Labels on Axes\n * https://www.yuque.com/preview/yuque/0/2019/pdf/185317/1546999150858-45c3b9c2-4e86-4223-bf1a-8a732e8195ed.pdf\n * @param dMin 最小值\n * @param dMax 最大值\n * @param m tick个数\n * @param onlyLoose 是否允许扩展min、max,不绝对强制,例如[3, 97]\n * @param Q nice numbers集合\n * @param w 四个优化组件的权重\n */\nexport const wilkinsonExtended = (dMin, dMax, n = 5, onlyLoose = true, Q = DEFAULT_Q, w = [0.25, 0.2, 0.5, 0.05]) => {\n const m = n < 0 ? 0 : Math.round(n);\n // nan 也会导致异常\n if (Number.isNaN(dMin) || Number.isNaN(dMax) || typeof dMin !== 'number' || typeof dMax !== 'number' || !m) {\n return [];\n }\n // js 极大值极小值问题,差值小于 1e-15 会导致计算出错\n if (dMax - dMin < 1e-15 || m === 1) {\n return [dMin];\n }\n const best = {\n score: -2,\n lmin: 0,\n lmax: 0,\n lstep: 0,\n };\n let j = 1;\n while (j < Infinity) {\n // for (const q of Q)\n for (let i = 0; i < Q.length; i += 1) {\n const q = Q[i];\n const sm = simplicityMax(q, Q, j);\n if (w[0] * sm + w[1] + w[2] + w[3] < best.score) {\n j = Infinity;\n break;\n }\n let k = 2;\n while (k < Infinity) {\n const dm = densityMax(k, m);\n if (w[0] * sm + w[1] + w[2] * dm + w[3] < best.score) {\n break;\n }\n const delta = (dMax - dMin) / (k + 1) / j / q;\n let z = Math.ceil(Math.log10(delta));\n while (z < Infinity) {\n const step = j * q * 10 ** z;\n const cm = coverageMax(dMin, dMax, step * (k - 1));\n if (w[0] * sm + w[1] * cm + w[2] * dm + w[3] < best.score) {\n break;\n }\n const minStart = Math.floor(dMax / step) * j - (k - 1) * j;\n const maxStart = Math.ceil(dMin / step) * j;\n if (minStart <= maxStart) {\n const count = maxStart - minStart;\n for (let i = 0; i <= count; i += 1) {\n const start = minStart + i;\n const lMin = start * (step / j);\n const lMax = lMin + step * (k - 1);\n const lStep = step;\n const s = simplicity(q, Q, j, lMin, lMax, lStep);\n const c = coverage(dMin, dMax, lMin, lMax);\n const g = density(k, m, dMin, dMax, lMin, lMax);\n const l = legibility();\n const score = w[0] * s + w[1] * c + w[2] * g + w[3] * l;\n if (score > best.score && (!onlyLoose || (lMin <= dMin && lMax >= dMax))) {\n best.lmin = lMin;\n best.lmax = lMax;\n best.lstep = lStep;\n best.score = score;\n }\n }\n }\n z += 1;\n }\n k += 1;\n }\n }\n j += 1;\n }\n // 处理精度问题,保证这三个数没有精度问题\n const lmax = prettyNumber(best.lmax);\n const lmin = prettyNumber(best.lmin);\n const lstep = prettyNumber(best.lstep);\n // 加 round 是为处理 extended(0.94, 1, 5)\n // 保证生成的 tickCount 没有精度问题\n const tickCount = Math.floor(round((lmax - lmin) / lstep)) + 1;\n const ticks = new Array(tickCount);\n // 少用乘法:防止出现 -1.2 + 1.2 * 3 = 2.3999999999999995 的情况\n ticks[0] = prettyNumber(lmin);\n for (let i = 1; i < tickCount; i += 1) {\n ticks[i] = prettyNumber(ticks[i - 1] + lstep);\n }\n return ticks;\n};\n//# sourceMappingURL=wilkinson-extended.js.map","import { isNumber } from '@antv/util';\nimport { Base } from './base';\nimport { wilkinsonExtended } from '../tick-methods/wilkinson-extended';\nimport { isValid } from '../utils';\nexport class Identity extends Base {\n /**\n * 返回需要覆盖的默认选项\n * @returns 需要覆盖的默认选项\n */\n getDefaultOptions() {\n return {\n domain: [0, 1],\n range: [0, 1],\n tickCount: 5,\n unknown: undefined,\n tickMethod: wilkinsonExtended,\n };\n }\n /**\n * 输入和输出满足:y = x\n * @param x 输入值\n * @returns 输出值\n */\n map(x) {\n return isValid(x) ? x : this.options.unknown;\n }\n /**\n * map 的逆运算:x = y,在这里和 map 是相同方法\n * @param x 输出值\n * @returns 输入值\n */\n invert(x) {\n return this.map(x);\n }\n /**\n * 克隆 Identity Scale\n * @returns 拥有相同选项且独立的 Identity Scale\n */\n clone() {\n return new Identity(this.options);\n }\n /**\n * 根据比例尺的配置去生成 ticks,该 ticks 主要用于生成坐标轴\n * @returns 返回一个 ticks 的数组\n */\n getTicks() {\n const { domain, tickCount, tickMethod } = this.options;\n const [min, max] = domain;\n if (!isNumber(min) || !isNumber(max))\n return [];\n return tickMethod(min, max, tickCount);\n }\n}\n//# sourceMappingURL=identity.js.map","import { identity } from '@antv/util';\nimport { Base } from './base';\nimport { createInterpolateNumber, createInterpolateRound, createClamp, createNormalize, bisect, compose, d3LinearNice, isValid, } from '../utils';\n/** 当 domain 和 range 只有一段的时候的 map 的 工厂函数 */\nconst createBiMap = (domain, range, createInterpolate) => {\n const [d0, d1] = domain;\n const [r0, r1] = range;\n let normalize;\n let interpolate;\n if (d0 < d1) {\n normalize = createNormalize(d0, d1);\n interpolate = createInterpolate(r0, r1);\n }\n else {\n normalize = createNormalize(d1, d0);\n interpolate = createInterpolate(r1, r0);\n }\n return compose(interpolate, normalize);\n};\n/** 当 domain 和 range 有多段时候的 map 的 工厂函数 */\nconst createPolyMap = (domain, range, createInterpolate) => {\n const len = Math.min(domain.length, range.length) - 1;\n const normalizeList = new Array(len);\n const interpolateList = new Array(len);\n const reverse = domain[0] > domain[len];\n const ascendingDomain = reverse ? [...domain].reverse() : domain;\n const ascendingRange = reverse ? [...range].reverse() : range;\n // 每一段都生成 normalize 和 interpolate\n for (let i = 0; i < len; i += 1) {\n normalizeList[i] = createNormalize(ascendingDomain[i], ascendingDomain[i + 1]);\n interpolateList[i] = createInterpolate(ascendingRange[i], ascendingRange[i + 1]);\n }\n // 二分最右查找到相应的 normalize 和 interpolate\n return (x) => {\n const i = bisect(domain, x, 1, len) - 1;\n const normalize = normalizeList[i];\n const interpolate = interpolateList[i];\n return compose(interpolate, normalize)(x);\n };\n};\n/** 选择一个分段映射的函数 */\nconst choosePiecewise = (domain, range, interpolate, shouldRound) => {\n const n = Math.min(domain.length, range.length);\n const createPiecewise = n > 2 ? createPolyMap : createBiMap;\n const createInterpolate = shouldRound ? createInterpolateRound : interpolate;\n return createPiecewise(domain, range, createInterpolate);\n};\n/**\n * Continuous 比例尺 的输入 x 和输出 y 满足:y = a * f(x) + b\n * 通过函数柯里化和复合函数可以在映射过程中去掉分支,提高性能。\n * 参考:https://github.com/d3/d3-scale/blob/master/src/continuous.js\n */\nexport class Continuous extends Base {\n getDefaultOptions() {\n return {\n domain: [0, 1],\n range: [0, 1],\n nice: false,\n clamp: false,\n round: false,\n interpolate: createInterpolateNumber,\n tickCount: 5,\n };\n }\n /**\n * y = interpolate(normalize(clamp(transform(x))))\n */\n map(x) {\n if (!isValid(x))\n return this.options.unknown;\n return this.output(x);\n }\n /**\n * x = transform(clamp(interpolate(normalize(y))))\n */\n invert(x) {\n if (!isValid(x))\n return this.options.unknown;\n return this.input(x);\n }\n nice() {\n if (!this.options.nice)\n return;\n const [min, max, tickCount, ...rest] = this.getTickMethodOptions();\n this.options.domain = this.chooseNice()(min, max, tickCount, ...rest);\n }\n getTicks() {\n const { tickMethod } = this.options;\n const [min, max, tickCount, ...rest] = this.getTickMethodOptions();\n return tickMethod(min, max, tickCount, ...rest);\n }\n getTickMethodOptions() {\n const { domain, tickCount } = this.options;\n const min = domain[0];\n const max = domain[domain.length - 1];\n return [min, max, tickCount];\n }\n chooseNice() {\n return d3LinearNice;\n }\n rescale() {\n this.nice();\n const [transform, untransform] = this.chooseTransforms();\n this.composeOutput(transform, this.chooseClamp(transform));\n this.composeInput(transform, untransform, this.chooseClamp(untransform));\n }\n chooseClamp(transform) {\n const { clamp: shouldClamp, range } = this.options;\n const domain = this.options.domain.map(transform);\n const n = Math.min(domain.length, range.length);\n return shouldClamp ? createClamp(domain[0], domain[n - 1]) : identity;\n }\n composeOutput(transform, clamp) {\n const { domain, range, round, interpolate } = this.options;\n const piecewise = choosePiecewise(domain.map(transform), range, interpolate, round);\n this.output = compose(piecewise, clamp, transform);\n }\n composeInput(transform, untransform, clamp) {\n const { domain, range } = this.options;\n const piecewise = choosePiecewise(range, domain.map(transform), createInterpolateNumber);\n this.input = compose(untransform, clamp, piecewise);\n }\n}\n//# sourceMappingURL=continuous.js.map","import { identity } from '@antv/util';\nimport { Continuous } from './continuous';\nimport { createInterpolateValue } from '../utils';\nimport { d3Ticks } from '../tick-methods/d3-ticks';\n/**\n * Linear 比例尺\n *\n * 构造可创建一个在输入和输出之间具有线性关系的比例尺\n */\nexport class Linear extends Continuous {\n getDefaultOptions() {\n return {\n domain: [0, 1],\n range: [0, 1],\n unknown: undefined,\n nice: false,\n clamp: false,\n round: false,\n interpolate: createInterpolateValue,\n tickMethod: d3Ticks,\n tickCount: 5,\n };\n }\n chooseTransforms() {\n return [identity, identity];\n }\n clone() {\n return new Linear(this.options);\n }\n}\n//# sourceMappingURL=linear.js.map","import { Band } from './band';\nimport { defaultUnknown } from './ordinal';\n/**\n * Point 比例尺\n *\n * 一种特殊的 band scale,它的 bandWidth 恒为 0。\n *\n * 由于部分选项较为抽象,见下图描述:\n *\n * PO = Padding = PaddingInner\n * domain = [\"A\", \"B\", \"C\"]\n *\n * |<------------------------------------------- range ------------------------------------------->|\n * | | | | |\n * |<--step*PO-->|<--------------step------------->|<--------------step------------->|<--step*PO-->|\n * | | | | |\n * | A B C |\n * |-----------------------------------------------------------------------------------------------|\n *\n * 性能方便较 d3 快出 8 - 9 倍\n */\nexport class Point extends Band {\n // 覆盖默认配置\n getDefaultOptions() {\n return {\n domain: [],\n range: [0, 1],\n align: 0.5,\n round: false,\n padding: 0,\n unknown: defaultUnknown,\n paddingInner: 1,\n paddingOuter: 0,\n };\n }\n // 能接受的参数只是 PointOptions,不能有 paddingInner 这些属性\n constructor(options) {\n super(options);\n }\n // Point 的 paddingInner 只能是1,不能被覆盖\n getPaddingInner() {\n return 1;\n }\n clone() {\n return new Point(this.options);\n }\n update(options) {\n super.update(options);\n }\n getPaddingOuter() {\n return this.options.padding;\n }\n}\n//# sourceMappingURL=point.js.map","import { identity } from '@antv/util';\nimport { Continuous } from './continuous';\nimport { createInterpolateValue } from '../utils';\nimport { d3Ticks } from '../tick-methods/d3-ticks';\nconst transformPow = (exponent) => {\n return (x) => {\n return x < 0 ? -((-x) ** exponent) : x ** exponent;\n };\n};\nconst transformPowInvert = (exponent) => {\n return (x) => {\n return x < 0 ? -((-x) ** (1 / exponent)) : x ** (1 / exponent);\n };\n};\nconst transformSqrt = (x) => {\n return x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);\n};\n/**\n * Pow 比例尺\n *\n * 类似于 linear scale, 不同之处在于在计算输出范围值之前对输入域值应用了指数变换,.\n * 即 y = x ^ k 其中 k(指数)可以是任何实数。\n */\nexport class Pow extends Continuous {\n getDefaultOptions() {\n return {\n domain: [0, 1],\n range: [0, 1],\n nice: false,\n clamp: false,\n round: false,\n exponent: 2,\n interpolate: createInterpolateValue,\n tickMethod: d3Ticks,\n tickCount: 5,\n };\n }\n // 显示指定 options 的类型为 PowOptions O 的类型\n constructor(options) {\n super(options);\n }\n chooseTransforms() {\n const { exponent } = this.options;\n if (exponent === 1)\n return [identity, identity];\n const transform = exponent === 0.5 ? transformSqrt : transformPow(exponent);\n const untransform = transformPowInvert(exponent);\n return [transform, untransform];\n }\n clone() {\n return new Pow(this.options);\n }\n}\n//# sourceMappingURL=pow.js.map","import { createInterpolateValue } from '../utils';\nimport { Pow } from './pow';\nimport { d3Ticks } from '../tick-methods/d3-ticks';\nexport class Sqrt extends Pow {\n getDefaultOptions() {\n return {\n domain: [0, 1],\n range: [0, 1],\n nice: false,\n clamp: false,\n round: false,\n interpolate: createInterpolateValue,\n tickMethod: d3Ticks,\n tickCount: 5,\n exponent: 0.5,\n };\n }\n constructor(options) {\n super(options);\n }\n update(options) {\n super.update(options);\n }\n clone() {\n return new Sqrt(this.options);\n }\n}\n//# sourceMappingURL=sqrt.js.map","import { Base } from './base';\nimport { bisect, isValid } from '../utils';\n/**\n * 将连续的定义域分段,每一段所有的值对应离散的值域中一个值\n */\nexport class Threshold extends Base {\n getDefaultOptions() {\n return {\n domain: [0.5],\n range: [0, 1],\n };\n }\n constructor(options) {\n super(options);\n }\n /**\n * 二分查找到输入值在哪一段,返回对应的值域中的值\n */\n map(x) {\n if (!isValid(x))\n return this.options.unknown;\n const index = bisect(this.thresholds, x, 0, this.n);\n return this.options.range[index];\n }\n /**\n * 在值域中找到对应的值,并返回在定义域中属于哪一段\n */\n invert(y) {\n const { range } = this.options;\n const index = range.indexOf(y);\n const domain = this.thresholds;\n return [domain[index - 1], domain[index]];\n }\n clone() {\n return new Threshold(this.options);\n }\n rescale() {\n const { domain, range } = this.options;\n this.n = Math.min(domain.length, range.length - 1);\n this.thresholds = domain;\n }\n}\n//# sourceMappingURL=threshold.js.map","import { d3Ticks } from './d3-ticks';\nimport { pows, logs } from '../utils';\nexport const d3Log = (a, b, n, base = 10) => {\n const shouldReflect = a < 0;\n const pow = pows(base, shouldReflect);\n const log = logs(base, shouldReflect);\n const r = b < a;\n const min = r ? b : a;\n const max = r ? a : b;\n let i = log(min);\n let j = log(max);\n let ticks = [];\n // 如果 base 是整数\n if (!(base % 1) && j - i < n) {\n i = Math.floor(i);\n j = Math.ceil(j);\n if (shouldReflect) {\n for (; i <= j; i += 1) {\n const p = pow(i);\n for (let k = base - 1; k >= 1; k -= 1) {\n const t = p * k;\n if (t > max)\n break;\n if (t >= min)\n ticks.push(t);\n }\n }\n }\n else {\n for (; i <= j; i += 1) {\n const p = pow(i);\n for (let k = 1; k < base; k += 1) {\n const t = p * k;\n if (t > max)\n break;\n if (t >= min)\n ticks.push(t);\n }\n }\n }\n if (ticks.length * 2 < n)\n ticks = d3Ticks(min, max, n);\n }\n else {\n const count = n === -1 ? j - i : Math.min(j - i, n);\n ticks = d3Ticks(i, j, count).map(pow);\n }\n return r ? ticks.reverse() : ticks;\n};\n//# sourceMappingURL=d3-log.js.map","import { Continuous } from './continuous';\nimport { createInterpolateValue, logs, pows } from '../utils';\nimport { d3Log } from '../tick-methods/d3-log';\nimport { d3LogNice } from '../utils/d3-log-nice';\n/**\n * Linear 比例尺\n *\n * 构造一个线性的对数比例尺\n */\nexport class Log extends Continuous {\n getDefaultOptions() {\n return {\n domain: [1, 10],\n range: [0, 1],\n base: 10,\n interpolate: createInterpolateValue,\n tickMethod: d3Log,\n tickCount: 5,\n };\n }\n chooseNice() {\n return d3LogNice;\n }\n getTickMethodOptions() {\n const { domain, tickCount, base } = this.options;\n const min = domain[0];\n const max = domain[domain.length - 1];\n return [min, max, tickCount, base];\n }\n chooseTransforms() {\n const { base, domain } = this.options;\n const shouldReflect = domain[0] < 0;\n return [logs(base, shouldReflect), pows(base, shouldReflect)];\n }\n clone() {\n return new Log(this.options);\n }\n}\n//# sourceMappingURL=log.js.map","import { Threshold } from './threshold';\nimport { wilkinsonExtended } from '../tick-methods/wilkinson-extended';\nimport { d3LinearNice } from '../utils';\n/**\n * 类似 Threshold 比例尺,区别在于 thresholds 是根据连续的 domain 根据离散的 range 的数量计算而得到的。\n */\nexport class Quantize extends Threshold {\n getDefaultOptions() {\n return {\n domain: [0, 1],\n range: [0.5],\n nice: false,\n tickCount: 5,\n tickMethod: wilkinsonExtended,\n };\n }\n constructor(options) {\n super(options);\n }\n nice() {\n const { nice } = this.options;\n if (nice) {\n const [min, max, tickCount] = this.getTickMethodOptions();\n this.options.domain = d3LinearNice(min, max, tickCount);\n }\n }\n getTicks() {\n const { tickMethod } = this.options;\n const [min, max, tickCount] = this.getTickMethodOptions();\n return tickMethod(min, max, tickCount);\n }\n getTickMethodOptions() {\n const { domain, tickCount } = this.options;\n const min = domain[0];\n const max = domain[domain.length - 1];\n return [min, max, tickCount];\n }\n rescale() {\n this.nice();\n const { range, domain } = this.options;\n const [x0, x1] = domain;\n this.n = range.length - 1;\n this.thresholds = new Array(this.n);\n for (let i = 0; i < this.n; i += 1) {\n this.thresholds[i] = ((i + 1) * x1 - (i - this.n) * x0) / (this.n + 1);\n }\n }\n /**\n * 如果是在第一段后或者最后一段就把两端的值添加上\n */\n invert(y) {\n const [a, b] = super.invert(y);\n const [x0, x1] = this.options.domain;\n return a === undefined && b === undefined ? [a, b] : [a || x0, b || x1];\n }\n getThresholds() {\n return this.thresholds;\n }\n clone() {\n return new Quantize(this.options);\n }\n}\n//# sourceMappingURL=quantize.js.map","/**\n * 给予一个排序好的数组,分位数\n *\n * @param arr 排序好的数组\n * @param percentage 百分比\n * @returns {number} 计算结果\n */\nfunction quantileSorted(arr, percentage) {\n const len = arr.length;\n if (!len) {\n return undefined;\n }\n if (len < 2) {\n return arr[len - 1];\n }\n const i = (len - 1) * percentage;\n const i0 = Math.floor(i);\n const v0 = arr[i0];\n const v1 = arr[i0 + 1];\n return v0 + (v1 - v0) * (i - i0);\n}\n/**\n * 给定一个数组, 创建分位数数组\n *\n * @param arr 排序好的数组\n * @param n 分位数数组长度\n * @param isSorted 数组是否排序好\n * @returns {number[]} 分位数数组\n */\nexport function createQuartile(arr, n, isSorted = false) {\n const numberArr = arr;\n if (!isSorted) {\n numberArr.sort((a, b) => a - b);\n }\n const tmp = [];\n for (let i = 1; i < n; i += 1) {\n tmp.push(quantileSorted(numberArr, i / n));\n }\n return tmp;\n}\n//# sourceMappingURL=create-quartile.js.map","import { Threshold } from './threshold';\nimport { wilkinsonExtended } from '../tick-methods/wilkinson-extended';\nimport { createQuartile } from '../utils/create-quartile';\n/**\n * 类似 Threshold 比例尺,区别在于分位数比例尺 (Quantile) 将一个离散的输入域映射到一个离散的输出域\n * 输入域被指定为一组离散的样本值,输出域中的值的数量决定了分位数的数量。\n */\nexport class Quantile extends Threshold {\n getDefaultOptions() {\n return {\n domain: [],\n range: [],\n tickCount: 5,\n unknown: undefined,\n tickMethod: wilkinsonExtended,\n };\n }\n constructor(options) {\n super(options);\n }\n rescale() {\n const { domain, range } = this.options;\n this.n = range.length - 1;\n this.thresholds = createQuartile(domain, this.n + 1, false);\n }\n /**\n * 如果是在第一段后或者最后一段就把两端的值添加上\n */\n invert(y) {\n const [a, b] = super.invert(y);\n const { domain } = this.options;\n const dMin = domain[0];\n const dMax = domain[domain.length - 1];\n return a === undefined && b === undefined ? [a, b] : [a || dMin, b || dMax];\n }\n getThresholds() {\n return this.thresholds;\n }\n clone() {\n return new Quantile(this.options);\n }\n getTicks() {\n const { tickCount, domain, tickMethod } = this.options;\n const lastIndex = domain.length - 1;\n const min = domain[0];\n const max = domain[lastIndex];\n return tickMethod(min, max, tickCount);\n }\n}\n//# sourceMappingURL=quantile.js.map","var token = /d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\\1?|[aA]|\"[^\"]*\"|'[^']*'/g;\nvar twoDigitsOptional = \"\\\\d\\\\d?\";\nvar twoDigits = \"\\\\d\\\\d\";\nvar threeDigits = \"\\\\d{3}\";\nvar fourDigits = \"\\\\d{4}\";\nvar word = \"[^\\\\s]+\";\nvar literal = /\\[([^]*?)\\]/gm;\nfunction shorten(arr, sLen) {\n var newArr = [];\n for (var i = 0, len = arr.length; i < len; i++) {\n newArr.push(arr[i].substr(0, sLen));\n }\n return newArr;\n}\nvar monthUpdate = function (arrName) { return function (v, i18n) {\n var lowerCaseArr = i18n[arrName].map(function (v) { return v.toLowerCase(); });\n var index = lowerCaseArr.indexOf(v.toLowerCase());\n if (index > -1) {\n return index;\n }\n return null;\n}; };\nfunction assign(origObj) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var obj = args_1[_a];\n for (var key in obj) {\n // @ts-ignore ex\n origObj[key] = obj[key];\n }\n }\n return origObj;\n}\nvar dayNames = [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\"\n];\nvar monthNames = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n];\nvar monthNamesShort = shorten(monthNames, 3);\nvar dayNamesShort = shorten(dayNames, 3);\nvar defaultI18n = {\n dayNamesShort: dayNamesShort,\n dayNames: dayNames,\n monthNamesShort: monthNamesShort,\n monthNames: monthNames,\n amPm: [\"am\", \"pm\"],\n DoFn: function (dayOfMonth) {\n return (dayOfMonth +\n [\"th\", \"st\", \"nd\", \"rd\"][dayOfMonth % 10 > 3\n ? 0\n : ((dayOfMonth - (dayOfMonth % 10) !== 10 ? 1 : 0) * dayOfMonth) % 10]);\n }\n};\nvar globalI18n = assign({}, defaultI18n);\nvar setGlobalDateI18n = function (i18n) {\n return (globalI18n = assign(globalI18n, i18n));\n};\nvar regexEscape = function (str) {\n return str.replace(/[|\\\\{()[^$+*?.-]/g, \"\\\\$&\");\n};\nvar pad = function (val, len) {\n if (len === void 0) { len = 2; }\n val = String(val);\n while (val.length < len) {\n val = \"0\" + val;\n }\n return val;\n};\nvar formatFlags = {\n D: function (dateObj) { return String(dateObj.getDate()); },\n DD: function (dateObj) { return pad(dateObj.getDate()); },\n Do: function (dateObj, i18n) {\n return i18n.DoFn(dateObj.getDate());\n },\n d: function (dateObj) { return String(dateObj.getDay()); },\n dd: function (dateObj) { return pad(dateObj.getDay()); },\n ddd: function (dateObj, i18n) {\n return i18n.dayNamesShort[dateObj.getDay()];\n },\n dddd: function (dateObj, i18n) {\n return i18n.dayNames[dateObj.getDay()];\n },\n M: function (dateObj) { return String(dateObj.getMonth() + 1); },\n MM: function (dateObj) { return pad(dateObj.getMonth() + 1); },\n MMM: function (dateObj, i18n) {\n return i18n.monthNamesShort[dateObj.getMonth()];\n },\n MMMM: function (dateObj, i18n) {\n return i18n.monthNames[dateObj.getMonth()];\n },\n YY: function (dateObj) {\n return pad(String(dateObj.getFullYear()), 4).substr(2);\n },\n YYYY: function (dateObj) { return pad(dateObj.getFullYear(), 4); },\n h: function (dateObj) { return String(dateObj.getHours() % 12 || 12); },\n hh: function (dateObj) { return pad(dateObj.getHours() % 12 || 12); },\n H: function (dateObj) { return String(dateObj.getHours()); },\n HH: function (dateObj) { return pad(dateObj.getHours()); },\n m: function (dateObj) { return String(dateObj.getMinutes()); },\n mm: function (dateObj) { return pad(dateObj.getMinutes()); },\n s: function (dateObj) { return String(dateObj.getSeconds()); },\n ss: function (dateObj) { return pad(dateObj.getSeconds()); },\n S: function (dateObj) {\n return String(Math.round(dateObj.getMilliseconds() / 100));\n },\n SS: function (dateObj) {\n return pad(Math.round(dateObj.getMilliseconds() / 10), 2);\n },\n SSS: function (dateObj) { return pad(dateObj.getMilliseconds(), 3); },\n a: function (dateObj, i18n) {\n return dateObj.getHours() < 12 ? i18n.amPm[0] : i18n.amPm[1];\n },\n A: function (dateObj, i18n) {\n return dateObj.getHours() < 12\n ? i18n.amPm[0].toUpperCase()\n : i18n.amPm[1].toUpperCase();\n },\n ZZ: function (dateObj) {\n var offset = dateObj.getTimezoneOffset();\n return ((offset > 0 ? \"-\" : \"+\") +\n pad(Math.floor(Math.abs(offset) / 60) * 100 + (Math.abs(offset) % 60), 4));\n },\n Z: function (dateObj) {\n var offset = dateObj.getTimezoneOffset();\n return ((offset > 0 ? \"-\" : \"+\") +\n pad(Math.floor(Math.abs(offset) / 60), 2) +\n \":\" +\n pad(Math.abs(offset) % 60, 2));\n }\n};\nvar monthParse = function (v) { return +v - 1; };\nvar emptyDigits = [null, twoDigitsOptional];\nvar emptyWord = [null, word];\nvar amPm = [\n \"isPm\",\n word,\n function (v, i18n) {\n var val = v.toLowerCase();\n if (val === i18n.amPm[0]) {\n return 0;\n }\n else if (val === i18n.amPm[1]) {\n return 1;\n }\n return null;\n }\n];\nvar timezoneOffset = [\n \"timezoneOffset\",\n \"[^\\\\s]*?[\\\\+\\\\-]\\\\d\\\\d:?\\\\d\\\\d|[^\\\\s]*?Z?\",\n function (v) {\n var parts = (v + \"\").match(/([+-]|\\d\\d)/gi);\n if (parts) {\n var minutes = +parts[1] * 60 + parseInt(parts[2], 10);\n return parts[0] === \"+\" ? minutes : -minutes;\n }\n return 0;\n }\n];\nvar parseFlags = {\n D: [\"day\", twoDigitsOptional],\n DD: [\"day\", twoDigits],\n Do: [\"day\", twoDigitsOptional + word, function (v) { return parseInt(v, 10); }],\n M: [\"month\", twoDigitsOptional, monthParse],\n MM: [\"month\", twoDigits, monthParse],\n YY: [\n \"year\",\n twoDigits,\n function (v) {\n var now = new Date();\n var cent = +(\"\" + now.getFullYear()).substr(0, 2);\n return +(\"\" + (+v > 68 ? cent - 1 : cent) + v);\n }\n ],\n h: [\"hour\", twoDigitsOptional, undefined, \"isPm\"],\n hh: [\"hour\", twoDigits, undefined, \"isPm\"],\n H: [\"hour\", twoDigitsOptional],\n HH: [\"hour\", twoDigits],\n m: [\"minute\", twoDigitsOptional],\n mm: [\"minute\", twoDigits],\n s: [\"second\", twoDigitsOptional],\n ss: [\"second\", twoDigits],\n YYYY: [\"year\", fourDigits],\n S: [\"millisecond\", \"\\\\d\", function (v) { return +v * 100; }],\n SS: [\"millisecond\", twoDigits, function (v) { return +v * 10; }],\n SSS: [\"millisecond\", threeDigits],\n d: emptyDigits,\n dd: emptyDigits,\n ddd: emptyWord,\n dddd: emptyWord,\n MMM: [\"month\", word, monthUpdate(\"monthNamesShort\")],\n MMMM: [\"month\", word, monthUpdate(\"monthNames\")],\n a: amPm,\n A: amPm,\n ZZ: timezoneOffset,\n Z: timezoneOffset\n};\n// Some common format strings\nvar globalMasks = {\n default: \"ddd MMM DD YYYY HH:mm:ss\",\n shortDate: \"M/D/YY\",\n mediumDate: \"MMM D, YYYY\",\n longDate: \"MMMM D, YYYY\",\n fullDate: \"dddd, MMMM D, YYYY\",\n isoDate: \"YYYY-MM-DD\",\n isoDateTime: \"YYYY-MM-DDTHH:mm:ssZ\",\n shortTime: \"HH:mm\",\n mediumTime: \"HH:mm:ss\",\n longTime: \"HH:mm:ss.SSS\"\n};\nvar setGlobalDateMasks = function (masks) { return assign(globalMasks, masks); };\n/***\n * Format a date\n * @method format\n * @param {Date|number} dateObj\n * @param {string} mask Format of the date, i.e. 'mm-dd-yy' or 'shortDate'\n * @returns {string} Formatted date string\n */\nvar format = function (dateObj, mask, i18n) {\n if (mask === void 0) { mask = globalMasks[\"default\"]; }\n if (i18n === void 0) { i18n = {}; }\n if (typeof dateObj === \"number\") {\n dateObj = new Date(dateObj);\n }\n if (Object.prototype.toString.call(dateObj) !== \"[object Date]\" ||\n isNaN(dateObj.getTime())) {\n throw new Error(\"Invalid Date pass to format\");\n }\n mask = globalMasks[mask] || mask;\n var literals = [];\n // Make literals inactive by replacing them with @@@\n mask = mask.replace(literal, function ($0, $1) {\n literals.push($1);\n return \"@@@\";\n });\n var combinedI18nSettings = assign(assign({}, globalI18n), i18n);\n // Apply formatting rules\n mask = mask.replace(token, function ($0) {\n return formatFlags[$0](dateObj, combinedI18nSettings);\n });\n // Inline literal values back into the formatted value\n return mask.replace(/@@@/g, function () { return literals.shift(); });\n};\n/**\n * Parse a date string into a Javascript Date object /\n * @method parse\n * @param {string} dateStr Date string\n * @param {string} format Date parse format\n * @param {i18n} I18nSettingsOptional Full or subset of I18N settings\n * @returns {Date|null} Returns Date object. Returns null what date string is invalid or doesn't match format\n */\nfunction parse(dateStr, format, i18n) {\n if (i18n === void 0) { i18n = {}; }\n if (typeof format !== \"string\") {\n throw new Error(\"Invalid format in fecha parse\");\n }\n // Check to see if the format is actually a mask\n format = globalMasks[format] || format;\n // Avoid regular expression denial of service, fail early for really long strings\n // https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS\n if (dateStr.length > 1000) {\n return null;\n }\n // Default to the beginning of the year.\n var today = new Date();\n var dateInfo = {\n year: today.getFullYear(),\n month: 0,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n isPm: null,\n timezoneOffset: null\n };\n var parseInfo = [];\n var literals = [];\n // Replace all the literals with @@@. Hopefully a string that won't exist in the format\n var newFormat = format.replace(literal, function ($0, $1) {\n literals.push(regexEscape($1));\n return \"@@@\";\n });\n var specifiedFields = {};\n var requiredFields = {};\n // Change every token that we find into the correct regex\n newFormat = regexEscape(newFormat).replace(token, function ($0) {\n var info = parseFlags[$0];\n var field = info[0], regex = info[1], requiredField = info[3];\n // Check if the person has specified the same field twice. This will lead to confusing results.\n if (specifiedFields[field]) {\n throw new Error(\"Invalid format. \" + field + \" specified twice in format\");\n }\n specifiedFields[field] = true;\n // Check if there are any required fields. For instance, 12 hour time requires AM/PM specified\n if (requiredField) {\n requiredFields[requiredField] = true;\n }\n parseInfo.push(info);\n return \"(\" + regex + \")\";\n });\n // Check all the required fields are present\n Object.keys(requiredFields).forEach(function (field) {\n if (!specifiedFields[field]) {\n throw new Error(\"Invalid format. \" + field + \" is required in specified format\");\n }\n });\n // Add back all the literals after\n newFormat = newFormat.replace(/@@@/g, function () { return literals.shift(); });\n // Check if the date string matches the format. If it doesn't return null\n var matches = dateStr.match(new RegExp(newFormat, \"i\"));\n if (!matches) {\n return null;\n }\n var combinedI18nSettings = assign(assign({}, globalI18n), i18n);\n // For each match, call the parser function for that date part\n for (var i = 1; i < matches.length; i++) {\n var _a = parseInfo[i - 1], field = _a[0], parser = _a[2];\n var value = parser\n ? parser(matches[i], combinedI18nSettings)\n : +matches[i];\n // If the parser can't make sense of the value, return null\n if (value == null) {\n return null;\n }\n dateInfo[field] = value;\n }\n if (dateInfo.isPm === 1 && dateInfo.hour != null && +dateInfo.hour !== 12) {\n dateInfo.hour = +dateInfo.hour + 12;\n }\n else if (dateInfo.isPm === 0 && +dateInfo.hour === 12) {\n dateInfo.hour = 0;\n }\n var dateTZ;\n if (dateInfo.timezoneOffset == null) {\n dateTZ = new Date(dateInfo.year, dateInfo.month, dateInfo.day, dateInfo.hour, dateInfo.minute, dateInfo.second, dateInfo.millisecond);\n var validateFields = [\n [\"month\", \"getMonth\"],\n [\"day\", \"getDate\"],\n [\"hour\", \"getHours\"],\n [\"minute\", \"getMinutes\"],\n [\"second\", \"getSeconds\"]\n ];\n for (var i = 0, len = validateFields.length; i < len; i++) {\n // Check to make sure the date field is within the allowed range. Javascript dates allows values\n // outside the allowed range. If the values don't match the value was invalid\n if (specifiedFields[validateFields[i][0]] &&\n dateInfo[validateFields[i][0]] !== dateTZ[validateFields[i][1]]()) {\n return null;\n }\n }\n }\n else {\n dateTZ = new Date(Date.UTC(dateInfo.year, dateInfo.month, dateInfo.day, dateInfo.hour, dateInfo.minute - dateInfo.timezoneOffset, dateInfo.second, dateInfo.millisecond));\n // We can't validate dates in another timezone unfortunately. Do a basic check instead\n if (dateInfo.month > 11 ||\n dateInfo.month < 0 ||\n dateInfo.day > 31 ||\n dateInfo.day < 1 ||\n dateInfo.hour > 23 ||\n dateInfo.hour < 0 ||\n dateInfo.minute > 59 ||\n dateInfo.minute < 0 ||\n dateInfo.second > 59 ||\n dateInfo.second < 0) {\n return null;\n }\n }\n // Don't allow invalid dates\n return dateTZ;\n}\nvar fecha = {\n format: format,\n parse: parse,\n defaultI18n: defaultI18n,\n setGlobalDateI18n: setGlobalDateI18n,\n setGlobalDateMasks: setGlobalDateMasks\n};\n\nexport default fecha;\nexport { assign, format, parse, defaultI18n, setGlobalDateI18n, setGlobalDateMasks };\n//# sourceMappingURL=fecha.js.map\n","import { findTickInterval } from '../utils';\nexport const d3Time = (min, max, count, interval, utc) => {\n const r = min > max;\n const lo = r ? max : min;\n const hi = r ? min : max;\n const [tickInterval, step] = findTickInterval(lo, hi, count, interval, utc);\n const ticks = tickInterval.range(lo, new Date(+hi + 1), step, true);\n return r ? ticks.reverse() : ticks;\n};\n//# sourceMappingURL=d3-time.js.map","import { identity } from '@antv/util';\nimport { format } from 'fecha';\nimport { Continuous } from './continuous';\nimport { d3Time } from '../tick-methods/d3-time';\nimport { d3TimeNice, createInterpolateNumber, localIntervalMap, utcIntervalMap, chooseNiceTimeMask } from '../utils';\nfunction offset(date) {\n const minuteOffset = date.getTimezoneOffset();\n const d = new Date(date);\n d.setMinutes(d.getMinutes() + minuteOffset, d.getSeconds(), d.getMilliseconds());\n return d;\n}\nexport class Time extends Continuous {\n getDefaultOptions() {\n return {\n domain: [new Date(2000, 0, 1), new Date(2000, 0, 2)],\n range: [0, 1],\n nice: false,\n tickCount: 5,\n tickInterval: undefined,\n unknown: undefined,\n clamp: false,\n tickMethod: d3Time,\n interpolate: createInterpolateNumber,\n mask: undefined,\n utc: false,\n };\n }\n chooseTransforms() {\n const transform = (x) => +x;\n const untransform = (x) => new Date(x);\n return [transform, untransform];\n }\n chooseNice() {\n return d3TimeNice;\n }\n getTickMethodOptions() {\n const { domain, tickCount, tickInterval, utc } = this.options;\n const min = domain[0];\n const max = domain[domain.length - 1];\n return [min, max, tickCount, tickInterval, utc];\n }\n getFormatter() {\n const { mask, utc } = this.options;\n const maskMap = utc ? utcIntervalMap : localIntervalMap;\n const time = utc ? offset : identity; // fecha 不支持 utc 格式化,所以需要设置一个偏移\n return (d) => format(time(d), mask || chooseNiceTimeMask(d, maskMap));\n }\n clone() {\n return new Time(this.options);\n }\n}\n//# sourceMappingURL=time.js.map","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar Sequential_1;\nimport { identity } from '@antv/util';\nimport { d3Ticks } from '../tick-methods/d3-ticks';\nimport { compose, createInterpolateNumber, createNormalize, interpolatize } from '../utils';\nimport { Linear } from './linear';\nfunction rangeOf(interpolator) {\n return [interpolator(0), interpolator(1)];\n}\nconst normalizeDomain = (domain) => {\n const [d0, d1] = domain;\n // [d0, d1] => [0, 1]\n const normalize = compose(createInterpolateNumber(0, 1), createNormalize(d0, d1));\n return normalize;\n};\n/**\n * Sequential 比例尺\n *\n * 构造可创建一个在输入和输出之间通过插值函数进行转换的比例尺\n */\n// @Sequentialish\nlet Sequential = Sequential_1 = class Sequential extends Linear {\n getDefaultOptions() {\n return {\n domain: [0, 1],\n unknown: undefined,\n nice: false,\n clamp: false,\n round: false,\n interpolator: identity,\n tickMethod: d3Ticks,\n tickCount: 5,\n };\n }\n constructor(options) {\n super(options);\n }\n clone() {\n return new Sequential_1(this.options);\n }\n};\nSequential = Sequential_1 = __decorate([\n interpolatize(rangeOf, normalizeDomain)\n], Sequential);\nexport { Sequential };\n//# sourceMappingURL=sequential.js.map","import { Band } from '@antv/scale';\nimport { deepMix } from '@antv/util';\nimport { column, columnOf } from './utils/helper';\nimport { domainOf } from './utils/order';\nexport function rangeOf(value, scaleOptions, padding) {\n if (value === null)\n return [-0.5, 0.5];\n const domain = domainOf(value, scaleOptions);\n const scale = new Band({ domain, range: [0, 1], padding });\n const step = scale.getBandWidth();\n return [-step / 2, step / 2];\n}\nexport function interpolate(t, a, b) {\n return a * (1 - t) + b * t;\n}\n/**\n * The jitter transform produce dx and dy channels for marks (especially for point)\n * with ordinal x and y dimension, say to make them jitter in their own space.\n */\nexport const Jitter = (options = {}) => {\n const { padding = 0, paddingX = padding, paddingY = padding, random = Math.random, } = options;\n return (I, mark) => {\n const { encode, scale } = mark;\n const { x: scaleX, y: scaleY } = scale;\n const [X] = columnOf(encode, 'x');\n const [Y] = columnOf(encode, 'y');\n const rangeX = rangeOf(X, scaleX, paddingX);\n const rangeY = rangeOf(Y, scaleY, paddingY);\n const DY = I.map(() => interpolate(random(), ...rangeY));\n const DX = I.map(() => interpolate(random(), ...rangeX));\n return [\n I,\n deepMix({\n scale: {\n x: { padding: 0.5 },\n y: { padding: 0.5 },\n },\n }, mark, {\n encode: { dy: column(DY), dx: column(DX) },\n }),\n ];\n };\n};\nJitter.props = {};\n//# sourceMappingURL=jitter.js.map","import { deepMix } from '@antv/util';\nimport { column, columnOf } from './utils/helper';\nimport { rangeOf, interpolate } from './jitter';\n/**\n * The JitterX transform produce dy channels for marks (especially for point)\n * with ordinal x and y dimension, say to make them jitter in their own space.\n */\nexport const JitterX = (options = {}) => {\n const { padding = 0, random = Math.random } = options;\n return (I, mark) => {\n const { encode, scale } = mark;\n const { x: scaleX } = scale;\n const [X] = columnOf(encode, 'x');\n const rangeX = rangeOf(X, scaleX, padding);\n const DX = I.map(() => interpolate(random(), ...rangeX));\n return [\n I,\n deepMix({ scale: { x: { padding: 0.5 } } }, mark, {\n encode: { dx: column(DX) },\n }),\n ];\n };\n};\nJitterX.props = {};\n//# sourceMappingURL=jitterX.js.map","import { deepMix } from '@antv/util';\nimport { column, columnOf } from './utils/helper';\nimport { rangeOf, interpolate } from './jitter';\n/**\n * The JitterY transform produce dy channels for marks (especially for point)\n * with ordinal x and y dimension, say to make them jitter in their own space.\n */\nexport const JitterY = (options = {}) => {\n const { padding = 0, random = Math.random } = options;\n return (I, mark) => {\n const { encode, scale } = mark;\n const { y: scaleY } = scale;\n const [Y] = columnOf(encode, 'y');\n const rangeY = rangeOf(Y, scaleY, padding);\n const DY = I.map(() => interpolate(random(), ...rangeY));\n return [\n I,\n deepMix({ scale: { y: { padding: 0.5 } } }, mark, {\n encode: { dy: column(DY) },\n }),\n ];\n };\n};\nJitterY.props = {};\n//# sourceMappingURL=jitterY.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { deepMix } from '@antv/util';\nimport { extent } from 'd3-array';\nimport { columnOf, column } from './utils/helper';\nimport { createGroups } from './utils/order';\n/**\n * The SymmetryY transform apply offset for y channels, say to transform\n * them to be symmetry.\n */\nexport const SymmetryY = (options = {}) => {\n const { groupBy = 'x' } = options;\n return (I, mark) => {\n const { encode } = mark;\n const { x } = encode, rest = __rest(encode, [\"x\"]);\n // Extract and create new channels starts with y, such as y, y1.\n const Yn = Object.entries(rest)\n .filter(([k]) => k.startsWith('y'))\n .map(([k]) => [k, columnOf(encode, k)[0]]);\n const newYn = Yn.map(([k]) => [k, new Array(I.length)]);\n // Group marks into series by specified keys.\n const groups = createGroups(groupBy, I, mark);\n const MY = new Array(groups.length);\n for (let i = 0; i < groups.length; i++) {\n const I = groups[i];\n const Y = I.flatMap((i) => Yn.map(([, V]) => +V[i]));\n const [minY, maxY] = extent(Y);\n MY[i] = (minY + maxY) / 2;\n }\n const maxMiddleY = Math.max(...MY);\n for (let m = 0; m < groups.length; m++) {\n const offset = maxMiddleY - MY[m];\n const I = groups[m];\n for (const i of I) {\n for (let j = 0; j < Yn.length; j++) {\n const [, V] = Yn[j];\n const [, newV] = newYn[j];\n newV[i] = +V[i] + offset;\n }\n }\n }\n return [\n I,\n deepMix({}, mark, {\n encode: Object.fromEntries(newYn.map(([k, v]) => [k, column(v, columnOf(encode, k)[1])])),\n }),\n ];\n };\n};\nSymmetryY.props = {};\n//# sourceMappingURL=symmetryY.js.map","import { deepMix } from '@antv/util';\nimport { column, columnOf, maybeColumnOf } from './utils/helper';\nimport { createGroups } from './utils/order';\n/**\n * The DiffY transform apply offset for y0 channels.\n * Keep y unchanged, set y1 = max(otherY), if y1 > y, remove the data.\n */\nexport const DiffY = (options = {}) => {\n const { groupBy = 'x', series = true } = options;\n return (I, mark) => {\n const { encode } = mark;\n const [Y] = columnOf(encode, 'y');\n const [_, fy1] = columnOf(encode, 'y1');\n const [S] = series\n ? maybeColumnOf(encode, 'series', 'color')\n : columnOf(encode, 'color');\n // Create groups and apply specified order for each group.\n const groups = createGroups(groupBy, I, mark);\n // Only adjust Y1 channel.\n const newY1 = new Array(I.length);\n for (const G of groups) {\n const YG = G.map((i) => +Y[i]);\n // Process each series.\n for (let idx = 0; idx < G.length; idx++) {\n const i = G[idx];\n // Get the max Y of current group with current Y exclude.\n const max = Math.max(...YG.filter((_, _i) => _i !== idx));\n // Diff Y value.\n newY1[i] = Y[i] > max ? max : Y[i];\n }\n }\n return [\n I,\n deepMix({}, mark, {\n encode: {\n y1: column(newY1, fy1),\n },\n }),\n ];\n };\n};\nDiffY.props = {};\n//# sourceMappingURL=diffY.js.map","import { maxIndex, minIndex } from 'd3-array';\nimport { columnOf } from './utils/helper';\nimport { createGroups } from './utils/order';\nfunction first(I, V) {\n return [I[0]];\n}\nfunction last(I, V) {\n const i = I.length - 1;\n return [I[i]];\n}\nfunction max(I, V) {\n const i = maxIndex(I, (i) => V[i]);\n return [I[i]];\n}\nfunction min(I, V) {\n const i = minIndex(I, (i) => V[i]);\n return [I[i]];\n}\nfunction normalizeSelector(selector) {\n if (typeof selector === 'function')\n return selector;\n const registry = { first, last, max, min };\n return registry[selector] || first;\n}\n/**\n * The select transform groups marks with specified channels, and\n * filter index by specified selector for each series, say to\n * pull a single or multiple values out of each series.\n */\nexport const Select = (options = {}) => {\n const { groupBy = 'series', channel, selector } = options;\n return (I, mark) => {\n const { encode } = mark;\n const groups = createGroups(groupBy, I, mark);\n const [V] = columnOf(encode, channel);\n const selectFunction = normalizeSelector(selector);\n return [groups.flatMap((GI) => selectFunction(GI, V)), mark];\n };\n};\nSelect.props = {};\n//# sourceMappingURL=select.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { Select } from './select';\n/**\n * The selectX transform filter index by y channel.\n */\nexport const SelectX = (options = {}) => {\n const { selector } = options, rest = __rest(options, [\"selector\"]);\n return Select(Object.assign({ channel: 'x', selector }, rest));\n};\nSelectX.props = {};\n//# sourceMappingURL=selectX.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { Select } from './select';\n/**\n * The selectY transform filter index by y channel.\n */\nexport const SelectY = (options = {}) => {\n const { selector } = options, rest = __rest(options, [\"selector\"]);\n return Select(Object.assign({ channel: 'y', selector }, rest));\n};\nSelectY.props = {};\n//# sourceMappingURL=selectY.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { deepMix } from '@antv/util';\nimport { max as d3Max, mean as d3Mean, sum as d3Sum, min as d3Min, median as d3Median, } from 'd3-array';\nimport { indexOf } from '../utils/array';\nimport { columnOf, column, nonConstantColumn } from './utils/helper';\nfunction builtinFormatter(summary) {\n return (d) => (d === null ? summary : `${summary} of ${d}`);\n}\nfunction normalizeReducer(reducer) {\n if (typeof reducer === 'function')\n return [reducer, null];\n const registry = { mean, max, count, first, last, sum, min, median };\n const reducerFunction = registry[reducer];\n if (!reducerFunction)\n throw new Error(`Unknown reducer: ${reducer}.`);\n return reducerFunction();\n}\nfunction mean() {\n const reducer = (I, V) => d3Mean(I, (i) => +V[i]);\n const formatter = builtinFormatter('mean');\n return [reducer, formatter];\n}\nfunction median() {\n const reducer = (I, V) => d3Median(I, (i) => +V[i]);\n const formatter = builtinFormatter('median');\n return [reducer, formatter];\n}\nfunction max() {\n const reducer = (I, V) => d3Max(I, (i) => +V[i]);\n const formatter = builtinFormatter('max');\n return [reducer, formatter];\n}\nfunction min() {\n const reducer = (I, V) => d3Min(I, (i) => +V[i]);\n const formatter = builtinFormatter('min');\n return [reducer, formatter];\n}\nfunction count() {\n const reducer = (I, V) => I.length;\n const formatter = builtinFormatter('count');\n return [reducer, formatter];\n}\nfunction sum() {\n const reducer = (I, V) => d3Sum(I, (i) => +V[i]);\n const formatter = builtinFormatter('sum');\n return [reducer, formatter];\n}\nfunction first() {\n const reducer = (I, V) => V[I[0]];\n const formatter = builtinFormatter('first');\n return [reducer, formatter];\n}\nfunction last() {\n const reducer = (I, V) => V[I[I.length - 1]];\n const formatter = builtinFormatter('last');\n return [reducer, formatter];\n}\n/**\n * The Group transform group data by x and y channels, and aggregate.\n */\nexport const GroupN = (options = {}) => {\n const { groupBy } = options, rest = __rest(options, [\"groupBy\"]);\n return (I, mark) => {\n const { data, encode } = mark;\n const groups = groupBy(I, mark);\n if (!groups)\n return [I, mark];\n // Extract field from from channel\n // x1 from x, y1 from y, etc,.\n const maybeFrom = (field, reducer) => {\n if (field)\n return field;\n const { from } = reducer;\n if (!from)\n return field;\n const [, field1] = columnOf(encode, from);\n return field1;\n };\n const outputs = Object.entries(rest).map(([channel, reducer]) => {\n const [reducerFunction, formatter] = normalizeReducer(reducer);\n const [V, field] = columnOf(encode, channel);\n const field1 = maybeFrom(field, reducer);\n const RV = groups.map((I) => reducerFunction(I, V !== null && V !== void 0 ? V : data));\n return [\n channel,\n Object.assign(Object.assign({}, nonConstantColumn(RV, (formatter === null || formatter === void 0 ? void 0 : formatter(field1)) || field1)), { aggregate: true }),\n ];\n });\n const reducedColumns = Object.keys(encode).map((key) => {\n const [V, fv] = columnOf(encode, key);\n const GV = groups.map((I) => V[I[0]]);\n return [key, column(GV, fv)];\n });\n const GD = groups.map((I) => data[I[0]]);\n const GI = indexOf(groups);\n return [\n GI,\n deepMix({}, mark, {\n data: GD,\n encode: Object.fromEntries([...reducedColumns, ...outputs]),\n }),\n ];\n };\n};\nGroupN.props = {};\n//# sourceMappingURL=groupN.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { createGroups } from './utils/order';\nimport { GroupN } from './groupN';\n/**\n * The Group transform group data by x and y channels, and aggregate.\n */\nexport const Group = (options = {}) => {\n const { channels = ['x', 'y'] } = options, rest = __rest(options, [\"channels\"]);\n const groupBy = (I, mark) => createGroups(channels, I, mark);\n return GroupN(Object.assign(Object.assign({}, rest), { groupBy }));\n};\nGroup.props = {};\n//# sourceMappingURL=group.js.map","import { Group } from './group';\n/**\n * The GroupX transform group data by x channel, and aggregate.\n */\nexport const GroupX = (options = {}) => {\n return Group(Object.assign(Object.assign({}, options), { channels: ['x', 'color', 'series'] }));\n};\nGroupX.props = {};\n//# sourceMappingURL=groupX.js.map","import { Group } from './group';\n/**\n * The GroupY transform group data by x channel, and aggregate.\n */\nexport const GroupY = (options = {}) => {\n return Group(Object.assign(Object.assign({}, options), { channels: ['y', 'color', 'series'] }));\n};\nGroupY.props = {};\n//# sourceMappingURL=groupY.js.map","import { Group } from './group';\n/**\n * The GroupColor transform group data by x channel, and aggregate.\n */\nexport const GroupColor = (options = {}) => {\n return Group(Object.assign(Object.assign({}, options), { channels: ['color'] }));\n};\nGroupColor.props = {};\n//# sourceMappingURL=groupColor.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { deepMix } from '@antv/util';\nimport { groupSort, max, min, sum, mean, median, sort, } from 'd3-array';\nimport { columnOf } from './utils/helper';\nfunction createReducer(channel, options, encode) {\n const { by = channel, reducer = 'max' } = options;\n const [V] = columnOf(encode, by);\n if (typeof reducer === 'function')\n return (GI) => reducer(GI, V);\n if (reducer === 'max')\n return (GI) => max(GI, (i) => +V[i]);\n if (reducer === 'min')\n return (GI) => min(GI, (i) => +V[i]);\n if (reducer === 'sum')\n return (GI) => sum(GI, (i) => +V[i]);\n if (reducer === 'median')\n return (GI) => median(GI, (i) => +V[i]);\n if (reducer === 'mean')\n return (GI) => mean(GI, (i) => +V[i]);\n if (reducer === 'first')\n return (GI) => V[GI[0]];\n if (reducer === 'last')\n return (GI) => V[GI[GI.length - 1]];\n throw new Error(`Unknown reducer: ${reducer}`);\n}\nfunction sortQuantitative(I, mark, options) {\n const { reverse, channel } = options;\n const { encode } = mark;\n const [V] = columnOf(encode, channel);\n const sortedI = sort(I, (i) => V[i]);\n if (reverse)\n sortedI.reverse();\n // const s = typeof slice === 'number' ? [0, slice] : slice;\n return [sortedI, mark];\n}\n// If domain is specified, only sort data in the domain.\nfunction filterIndex(I, values, specifiedDomain) {\n if (!Array.isArray(specifiedDomain))\n return I;\n const domain = new Set(specifiedDomain);\n return I.filter((i) => domain.has(values[i]));\n}\nfunction sortOrdinal(I, mark, options) {\n var _a;\n const { reverse, slice, channel } = options, rest = __rest(options, [\"reverse\", \"slice\", \"channel\"]);\n const { encode, scale = {} } = mark;\n const domain = (_a = scale[channel]) === null || _a === void 0 ? void 0 : _a.domain;\n const [T] = columnOf(encode, channel);\n const normalizeReducer = createReducer(channel, rest, encode);\n const SI = filterIndex(I, T, domain);\n const sortedDomain = groupSort(SI, normalizeReducer, (i) => T[i]);\n if (reverse)\n sortedDomain.reverse();\n const s = typeof slice === 'number' ? [0, slice] : slice;\n const slicedDomain = slice ? sortedDomain.slice(...s) : sortedDomain;\n return [\n I,\n deepMix(mark, {\n scale: {\n [channel]: {\n domain: slicedDomain,\n },\n },\n }),\n ];\n}\n/**\n * Sort marks groups by groups.\n */\nexport const Sort = (options = {}) => {\n const { reverse = false, slice, channel, ordinal = true } = options, rest = __rest(options, [\"reverse\", \"slice\", \"channel\", \"ordinal\"]);\n return (I, mark) => {\n if (!ordinal) {\n return sortQuantitative(I, mark, Object.assign({ reverse,\n slice,\n channel }, rest));\n }\n return sortOrdinal(I, mark, Object.assign({ reverse, slice, channel }, rest));\n };\n};\nSort.props = {};\n//# sourceMappingURL=sort.js.map","import { Sort } from './sort';\n/**\n * Sort domain of x scale of mark groups by groups.\n */\nexport const SortX = (options = {}) => {\n return Sort(Object.assign(Object.assign({}, options), { channel: 'x' }));\n};\nSortX.props = {};\n//# sourceMappingURL=sortX.js.map","import { Sort } from './sort';\n/**\n * Sort domain of x scale of mark groups by groups.\n */\nexport const SortColor = (options = {}) => {\n return Sort(Object.assign(Object.assign({}, options), { channel: 'color' }));\n};\nSortColor.props = {};\n//# sourceMappingURL=sortColor.js.map","import { Sort } from './sort';\n/**\n * Sort domain of x scale of mark groups by groups.\n */\nexport const SortY = (options = {}) => {\n return Sort(Object.assign(Object.assign({}, options), { channel: 'y' }));\n};\nSortY.props = {};\n//# sourceMappingURL=sortY.js.map","import { deepMix } from '@antv/util';\nimport { rollups, sum } from 'd3-array';\nimport { columnOf } from './utils/helper';\nfunction valueOf(data, field) {\n if (typeof field === 'string')\n return data.map((d) => d[field]);\n return data.map(field);\n}\nfunction createReducer(reducer, V) {\n if (typeof reducer === 'function')\n return (GI) => reducer(GI, V);\n if (reducer === 'sum')\n return (GI) => sum(GI, (i) => +V[i]);\n throw new Error(`Unknown reducer: ${reducer}`);\n}\n/**\n * Produce flex options from data for x scale.\n */\nexport const FlexX = (options = {}) => {\n const { field, channel = 'y', reducer = 'sum' } = options;\n return (I, mark) => {\n const { data, encode } = mark;\n const [x] = columnOf(encode, 'x');\n const V = field ? valueOf(data, field) : columnOf(encode, channel)[0];\n const reducerFunction = createReducer(reducer, V);\n const flex = rollups(I, reducerFunction, (i) => x[i]).map((d) => d[1]);\n return [I, deepMix({}, mark, { scale: { x: { flex } } })];\n };\n};\nFlexX.props = {};\n//# sourceMappingURL=flexX.js.map","export function sub([x1, y1], [x2, y2]) {\n return [x1 - x2, y1 - y2];\n}\nexport function add([x1, y1], [x2, y2]) {\n return [x1 + x2, y1 + y2];\n}\nexport function dist([x0, y0], [x1, y1]) {\n return Math.sqrt(Math.pow((x0 - x1), 2) + Math.pow((y0 - y1), 2));\n}\n/**\n * Calculate angle of vector [x, y].\n */\nexport function angle([x, y]) {\n return Math.atan2(y, x);\n}\n/**\n * Calculate angle of [x, y], then + Math.PI / 2.\n * Because of the difference between `Geometric coordinate system` and `Visualization coordinate system`.\n * @returns\n */\nexport function angleWithQuadrant([x, y]) {\n return angle([x, y]) + Math.PI / 2;\n}\nexport function angleBetween(v0, v1) {\n const a0 = angle(v0);\n const a1 = angle(v1);\n if (a0 < a1)\n return a1 - a0;\n return Math.PI * 2 - (a0 - a1);\n}\nexport function calcBBox(points) {\n let minX = Infinity;\n let maxX = -Infinity;\n let minY = Infinity;\n let maxY = -Infinity;\n for (const [x, y] of points) {\n minX = Math.min(x, minX);\n maxX = Math.max(x, maxX);\n minY = Math.min(y, minY);\n maxY = Math.max(y, maxY);\n }\n const width = maxX - minX;\n const height = maxY - minY;\n return [minX, minY, width, height];\n}\n/**\n * Get the center of two points.\n */\nexport function mid([x1, y1], [x2, y2]) {\n return [(x1 + x2) / 2, (y1 + y2) / 2];\n}\n//# sourceMappingURL=vector.js.map","import { deepMix } from '@antv/util';\nimport { calcBBox } from '../utils/vector';\nfunction pack(options) {\n const { padding = 0, direction = 'col' } = options;\n return (P, count, layout) => {\n const pcount = P.length;\n if (pcount === 0)\n return [];\n // col * row >= count\n // row is close to col * aspect, so\n // col * (col * aspect) >= count\n const { innerWidth, innerHeight } = layout;\n const aspect = innerHeight / innerWidth;\n let col = Math.ceil(Math.sqrt(count / aspect));\n // Increase col to avoid total height of packed shape\n // being large than height of bbox.\n let size = innerWidth / col;\n let row = Math.ceil(count / col);\n let h0 = row * size;\n while (h0 > innerHeight) {\n col = col + 1;\n size = innerWidth / col;\n row = Math.ceil(count / col);\n h0 = row * size;\n }\n // Some offset to increase the space usage.\n const space = innerHeight - row * size;\n const intervalY = row <= 1 ? 0 : space / (row - 1);\n const [offsetX, offsetY] = row <= 1\n ? [\n (innerWidth - pcount * size) / (pcount - 1),\n (innerHeight - size) / 2,\n ]\n : [0, 0];\n return P.map((points, m) => {\n const [x, y, width, height] = calcBBox(points);\n const i = direction === 'col' ? m % col : Math.floor(m / row);\n const j = direction === 'col' ? Math.floor(m / col) : m % row;\n const newX = i * size;\n const newY = (row - j - 1) * size + space;\n const sx = (size - padding) / width;\n const sy = (size - padding) / height;\n // Translate the shape and mark to make sure the center of\n // shape is overlap before and after scale transformation.\n const tx = newX - x + offsetX * i + (1 / 2) * padding;\n const ty = newY - y - intervalY * j - offsetY + (1 / 2) * padding;\n return `translate(${tx}, ${ty}) scale(${sx}, ${sy})`;\n });\n };\n}\n/**\n * Uniform pack to avid overlap.\n * @todo Improve or change algorithm to increase space usage.\n * @todo Take some special case into account.\n */\nexport const Pack = (options) => {\n return (I, mark) => {\n return [I, deepMix({}, mark, { modifier: pack(options), axis: false })];\n };\n};\nPack.props = {};\n//# sourceMappingURL=pack.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { bin as d3Bin, group, thresholdScott, extent } from 'd3-array';\nimport { defined, subObject } from '../utils/helper';\nimport { GroupN } from './groupN';\nimport { columnOf } from './utils/helper';\nconst THRESHOLD = 'thresholds';\n/**\n * @see https://github.com/observablehq/plot/blob/main/src/transforms/bin.js\n */\nfunction thresholdAuto(values) {\n const [min, max] = extent(values);\n return Math.min(200, thresholdScott(values, min, max));\n}\n/**\n * The Bin aggregate data.\n * @todo More threshold method.\n * @todo Performance.\n */\nexport const Bin = (options = {}) => {\n const { groupChannels = ['color'], binChannels = ['x', 'y'] } = options, rest = __rest(options, [\"groupChannels\", \"binChannels\"]);\n const channelIndexKey = {};\n // Group indexes and update channelIndexKey.\n const groupBy = (I, mark) => {\n const { encode } = mark;\n const binValues = binChannels.map((channel) => {\n const [V] = columnOf(encode, channel);\n return V;\n });\n const thresholds = subObject(rest, THRESHOLD);\n const DI = I.filter((i) => binValues.every((V) => defined(V[i])));\n // Group indexes by both discrete and quantitative channels.\n const groupKeys = [\n // For discrete channels, use value as group key.\n ...groupChannels\n .map((d) => {\n const [V] = columnOf(encode, d);\n return V;\n })\n .filter(defined)\n .map((V) => (i) => V[i]),\n // For quantitative channels, use extent of bin as group key.\n ...binChannels.map((d, i) => {\n const V = binValues[i];\n const t = thresholds[d] || thresholdAuto(V);\n const bins = d3Bin()\n .thresholds(t)\n .value((i) => +V[i])(DI);\n const indexKey = new Map(bins.flatMap((bin) => {\n const { x0, x1 } = bin;\n const key = `${x0},${x1}`;\n return bin.map((i) => [i, key]);\n }));\n channelIndexKey[d] = indexKey;\n return (i) => indexKey.get(i);\n }),\n ];\n // Group by indexes by channel keys.\n const key = (i) => groupKeys.map((key) => key(i)).join('-');\n return Array.from(group(DI, key).values());\n };\n return GroupN(Object.assign(Object.assign(Object.assign({}, Object.fromEntries(Object.entries(rest).filter(([k]) => !k.startsWith(THRESHOLD)))), Object.fromEntries(binChannels.flatMap((channel) => {\n const start = ([i]) => +channelIndexKey[channel].get(i).split(',')[0];\n const end = ([i]) => +channelIndexKey[channel].get(i).split(',')[1];\n end.from = channel;\n return [\n [channel, start],\n [`${channel}1`, end],\n ];\n }))), { groupBy }));\n};\nBin.props = {};\n//# sourceMappingURL=bin.js.map","import { Bin } from './bin';\nexport const BinX = (options = {}) => {\n const { thresholds } = options;\n return Bin(Object.assign(Object.assign({}, options), { thresholdsX: thresholds, groupChannels: ['color'], binChannels: ['x'] }));\n};\nBinX.props = {};\n//# sourceMappingURL=binX.js.map","/**\n * Sample data with lttb(Largest-Triangle-Three-Buckets) algo (https://github.com/pingec/downsample-lttb).\n * Return the sampled index array.\n */\nexport function lttb(I, X, Y, thresholds) {\n const length = I.length;\n if (thresholds >= length || thresholds === 0) {\n return I;\n }\n const x = (i) => X[I[i]] * 1;\n const y = (i) => Y[I[i]] * 1;\n const sampled = [];\n // Bucket size. Leave room for start and end data points.\n const every = (length - 2) / (thresholds - 2);\n let a = 0; // Initially a is the first point in the triangle.\n let maxArea;\n let area;\n let nextA;\n sampled.push(a); // Always add the first point.\n for (let i = 0; i < thresholds - 2; i++) {\n // Calculate point average for next bucket (containing c).\n let avgX = 0;\n let avgY = 0;\n let start = Math.floor((i + 1) * every) + 1;\n let end = Math.floor((i + 2) * every) + 1;\n end = Math.min(end, length);\n const size = end - start;\n for (; start < end; start++) {\n avgX += x(start);\n avgY += y(start);\n }\n avgX /= size;\n avgY /= size;\n // Get the range for this bucket.\n let frameStart = Math.floor((i + 0) * every) + 1;\n const frameEnd = Math.floor((i + 1) * every) + 1;\n // Point a.\n const pointA = [x(a), y(a)];\n maxArea = area = -1;\n for (; frameStart < frameEnd; frameStart++) {\n // Calculate triangle area over three buckets.\n area =\n Math.abs((pointA[0] - avgX) * (x(frameStart) - pointA[1]) -\n (pointA[0] - y(frameStart)) * (avgY - pointA[0])) * 0.5;\n if (area > maxArea) {\n maxArea = area;\n nextA = frameStart; // Next a is this b.\n }\n }\n sampled.push(nextA); // Pick this point from the bucket.\n a = nextA; // This a is the next a (chosen b).\n }\n sampled.push(length - 1); // Always add last.\n return sampled.map((a) => I[a]);\n}\n//# sourceMappingURL=lttb.js.map","// @ts-ignore medianIndex exist in d3-array@3.2.0, but @types/d3-array Expired.\nimport { maxIndex, minIndex, medianIndex } from 'd3-array';\nimport { createGroups } from './utils/order';\nimport { columnOf } from './utils/helper';\nimport { lttb } from './utils/lttb';\nfunction normalizeSample(strategy) {\n if (typeof strategy === 'function')\n return strategy;\n if (strategy === 'lttb')\n return lttb;\n const strategies = {\n first: (f) => [f[0]],\n last: (f) => [f[f.length - 1]],\n min: (f, X, Y) => [\n f[minIndex(f, (i) => Y[i])],\n ],\n max: (f, X, Y) => [\n f[maxIndex(f, (i) => Y[i])],\n ],\n median: (f, X, Y) => [\n f[medianIndex(f, (i) => Y[i])],\n ],\n };\n const sampleFunction = strategies[strategy] || strategies.median;\n return (I, X, Y, thresholds) => {\n // Sepreate group to frames, then sample each frame.\n // Keep more data as possible.\n const frameSize = Math.max(1, Math.floor(I.length / thresholds));\n const frames = getFrames(I, frameSize);\n return frames.flatMap((frame) => sampleFunction(frame, X, Y));\n };\n}\n/**\n * Split the array into frame with each frameSize.\n */\nfunction getFrames(I, frameSize) {\n const size = I.length;\n const frames = [];\n let i = 0;\n while (i < size) {\n frames.push(I.slice(i, (i += frameSize)));\n }\n return frames;\n}\n/**\n * The sample transform groups marks with specified groupBy fields, and\n * sample data for each group when data.length >= threshold(default = 2000).\n */\nexport const Sample = (options = {}) => {\n const { strategy = 'median', thresholds = 2000, groupBy = ['series', 'color'], } = options;\n const sampleFunction = normalizeSample(strategy);\n return (I, mark) => {\n const { encode } = mark;\n const groups = createGroups(groupBy, I, mark);\n const [X] = columnOf(encode, 'x');\n const [Y] = columnOf(encode, 'y');\n return [\n groups.flatMap((g) => sampleFunction(g, X, Y, thresholds)),\n mark,\n ];\n };\n};\nSample.props = {};\n//# sourceMappingURL=sample.js.map","import { deepMix } from '@antv/util';\nimport { defined } from '../utils/helper';\nimport { columnOf } from './utils/helper';\nfunction normalizeValue(value) {\n if (typeof value === 'object')\n return [value.value, value.ordinal];\n else\n return [value, true];\n}\n/**\n * The Filter transform filter channels.\n */\nexport const Filter = (options = {}) => {\n return (I, mark) => {\n const { encode, data } = mark;\n const filters = Object.entries(options)\n .map(([key, v]) => {\n const [V] = columnOf(encode, key);\n // Skip empty channel.\n if (!V)\n return null;\n const [value, ordinal = true] = normalizeValue(v);\n if (typeof value === 'function')\n return (i) => value(V[i]);\n if (ordinal) {\n const expectedValues = Array.isArray(value) ? value : [value];\n // Skip empty expected values.\n if (expectedValues.length === 0)\n return null;\n return (i) => expectedValues.includes(V[i]);\n }\n else {\n const [start, end] = value;\n return (i) => V[i] >= start && V[i] <= end;\n }\n })\n .filter(defined);\n // Skip empty filters.\n if (filters.length === 0)\n return [I, mark];\n // Filter index and channels.\n const totalFilter = (i) => filters.every((f) => f(i));\n const FI = I.filter(totalFilter);\n const newIndex = FI.map((_, i) => i);\n const newEncodes = Object.entries(encode).map(([key, encode]) => {\n return [\n key,\n Object.assign(Object.assign({}, encode), { value: newIndex\n .map((i) => encode.value[FI[i]])\n .filter((v) => v !== undefined) }),\n ];\n });\n return [\n newIndex,\n deepMix({}, mark, {\n encode: Object.fromEntries(newEncodes),\n // Filter data for tooltip item.\n data: FI.map((i) => data[i]),\n }),\n ];\n };\n};\nFilter.props = {};\n//# sourceMappingURL=filter.js.map","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","const pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction append(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n let d = Math.floor(digits);\n if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);\n if (d > 15) return append;\n const k = 10 ** d;\n return function(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n}\n\nexport class Path {\n constructor(digits) {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n this._append = digits == null ? append : appendRound(digits);\n }\n moveTo(x, y) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;\n }\n closePath() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._append`Z`;\n }\n }\n lineTo(x, y) {\n this._append`L${this._x1 = +x},${this._y1 = +y}`;\n }\n quadraticCurveTo(x1, y1, x, y) {\n this._append`Q${+x1},${+y1},${this._x1 = +x},${this._y1 = +y}`;\n }\n bezierCurveTo(x1, y1, x2, y2, x, y) {\n this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x},${this._y1 = +y}`;\n }\n arcTo(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._append`M${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._append`L${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Otherwise, draw an arc!\n else {\n let x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;\n }\n\n this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;\n }\n }\n arc(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._append`M${x0},${y0}`;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._append`L${x0},${y0}`;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._append`A${r},${r},0,1,${cw},${x - dx},${y - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._append`A${r},${r},0,${+(da >= pi)},${cw},${this._x1 = x + r * Math.cos(a1)},${this._y1 = y + r * Math.sin(a1)}`;\n }\n }\n rect(x, y, w, h) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${w = +w}v${+h}h${-w}Z`;\n }\n toString() {\n return this._;\n }\n}\n\nexport function path() {\n return new Path;\n}\n\n// Allow instanceof d3.path\npath.prototype = Path.prototype;\n\nexport function pathRound(digits = 3) {\n return new Path(+digits);\n}\n","import {Path} from \"d3-path\";\n\nexport function withPath(shape) {\n let digits = 3;\n\n shape.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) {\n digits = null;\n } else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n return shape;\n };\n\n return () => new Path(digits);\n}\n","import constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\nimport {withPath} from \"./path.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null,\n path = withPath(arc);\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle. If this\n // intersection fails, it’s probably because the arc is too small, so\n // disable the corner radius entirely.\n if (da < pi) {\n if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n } else {\n rc0 = rc1 = 0;\n }\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector’s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it’s a circular sector?\n // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector’s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n","export var slice = Array.prototype.slice;\n\nexport default function(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n","function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x, y) {\n var defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(line);\n\n x = typeof x === \"function\" ? x : (x === undefined) ? pointX : constant(x);\n y = typeof y === \"function\" ? y : (y === undefined) ? pointY : constant(y);\n\n function line(data) {\n var i,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport line from \"./line.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x0, y0, y1) {\n var x1 = null,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(area);\n\n x0 = typeof x0 === \"function\" ? x0 : (x0 === undefined) ? pointX : constant(+x0);\n y0 = typeof y0 === \"function\" ? y0 : (y0 === undefined) ? constant(0) : constant(+y0);\n y1 = typeof y1 === \"function\" ? y1 : (y1 === undefined) ? pointY : constant(+y1);\n\n function area(data) {\n var i,\n j,\n k,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n","import curveLinear from \"./linear.js\";\n\nexport var curveRadialLinear = curveRadial(curveLinear);\n\nfunction Radial(curve) {\n this._curve = curve;\n}\n\nRadial.prototype = {\n areaStart: function() {\n this._curve.areaStart();\n },\n areaEnd: function() {\n this._curve.areaEnd();\n },\n lineStart: function() {\n this._curve.lineStart();\n },\n lineEnd: function() {\n this._curve.lineEnd();\n },\n point: function(a, r) {\n this._curve.point(r * Math.sin(a), r * -Math.cos(a));\n }\n};\n\nexport default function curveRadial(curve) {\n\n function radial(context) {\n return new Radial(curve(context));\n }\n\n radial._curve = curve;\n\n return radial;\n}\n","import curveRadial, {curveRadialLinear} from \"./curve/radial.js\";\nimport line from \"./line.js\";\n\nexport function lineRadial(l) {\n var c = l.curve;\n\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n\n l.curve = function(_) {\n return arguments.length ? c(curveRadial(_)) : c()._curve;\n };\n\n return l;\n}\n\nexport default function() {\n return lineRadial(line().curve(curveRadialLinear));\n}\n","import curveRadial, {curveRadialLinear} from \"./curve/radial.js\";\nimport area from \"./area.js\";\nimport {lineRadial} from \"./lineRadial.js\";\n\nexport default function() {\n var a = area().curve(curveRadialLinear),\n c = a.curve,\n x0 = a.lineX0,\n x1 = a.lineX1,\n y0 = a.lineY0,\n y1 = a.lineY1;\n\n a.angle = a.x, delete a.x;\n a.startAngle = a.x0, delete a.x0;\n a.endAngle = a.x1, delete a.x1;\n a.radius = a.y, delete a.y;\n a.innerRadius = a.y0, delete a.y0;\n a.outerRadius = a.y1, delete a.y1;\n a.lineStartAngle = function() { return lineRadial(x0()); }, delete a.lineX0;\n a.lineEndAngle = function() { return lineRadial(x1()); }, delete a.lineX1;\n a.lineInnerRadius = function() { return lineRadial(y0()); }, delete a.lineY0;\n a.lineOuterRadius = function() { return lineRadial(y1()); }, delete a.lineY1;\n\n a.curve = function(_) {\n return arguments.length ? c(curveRadial(_)) : c()._curve;\n };\n\n return a;\n}\n","export default function() {}\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import noop from \"../noop.js\";\nimport {point} from \"./cardinal.js\";\n\nexport function CardinalClosed(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalClosed(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {epsilon} from \"../math.js\";\nimport {Cardinal} from \"./cardinal.js\";\n\nexport function point(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalClosed} from \"./cardinalClosed.js\";\nimport noop from \"../noop.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomClosed(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import noop from \"../noop.js\";\n\nfunction LinearClosed(context) {\n this._context = context;\n}\n\nLinearClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._point) this._context.closePath();\n },\n point: function(x, y) {\n x = +x, y = +y;\n if (this._point) this._context.lineTo(x, y);\n else this._point = 1, this._context.moveTo(x, y);\n }\n};\n\nexport default function(context) {\n return new LinearClosed(context);\n}\n","function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n","function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n","export function isTranspose(coordinate) {\n const { transformations } = coordinate.getOptions();\n const transposes = transformations\n .map(([type]) => type)\n .filter((type) => type === 'transpose');\n return transposes.length % 2 !== 0;\n}\nexport function isPolar(coordinate) {\n const { transformations } = coordinate.getOptions();\n return transformations.some(([type]) => type === 'polar');\n}\nexport function isRadial(coordinate) {\n const { transformations } = coordinate.getOptions();\n return (\n // distinguish radial from theta.\n transformations.some(([type]) => type === 'reflect') &&\n transformations.some(([type]) => type.startsWith('transpose')));\n}\nexport function isHelix(coordinate) {\n const { transformations } = coordinate.getOptions();\n return transformations.some(([type]) => type === 'helix');\n}\nexport function isParallel(coordinate) {\n const { transformations } = coordinate.getOptions();\n return transformations.some(([type]) => type === 'parallel');\n}\nexport function isFisheye(coordinate) {\n const { transformations } = coordinate.getOptions();\n return transformations.some(([type]) => type === 'fisheye');\n}\nexport function isRadar(coordinate) {\n return isParallel(coordinate) && isPolar(coordinate);\n}\nexport function isCircular(coordinate) {\n return isHelix(coordinate) || isPolar(coordinate);\n}\nexport function isTheta(coordinate) {\n return isPolar(coordinate) && isTranspose(coordinate);\n}\nexport function isNonCartesian(coordinate) {\n return (isPolar(coordinate) ||\n isParallel(coordinate) ||\n isRadial(coordinate) ||\n isTheta(coordinate));\n}\nexport function getRadius(coordinate) {\n if (isCircular(coordinate)) {\n const [width, height] = coordinate.getSize();\n const polar = coordinate\n .getOptions()\n .transformations.find((t) => t[0] === 'polar');\n // coordinate.size * outerRadius.\n if (polar)\n return (Math.max(width, height) / 2) * polar[4];\n }\n return 0;\n}\nexport function radiusOf(coordinate) {\n const { transformations } = coordinate.getOptions();\n const [, , , innerRadius, outerRadius] = transformations.find((d) => d[0] === 'polar');\n return [+innerRadius, +outerRadius];\n}\nexport function angleOf(coordinate, isRadius = true) {\n const { transformations } = coordinate.getOptions();\n const [, startAngle, endAngle] = transformations.find((d) => d[0] === 'polar');\n return isRadius\n ? [(+startAngle * 180) / Math.PI, (+endAngle * 180) / Math.PI]\n : [startAngle, endAngle];\n}\nexport function getTransformOptions(coordinate, type) {\n const { transformations } = coordinate.getOptions();\n const [, ...args] = transformations.find((d) => d[0] === type);\n return args;\n}\n//# sourceMappingURL=coordinate.js.map","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n","import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(\"^rgb\\\\(\" + [reI, reI, reI] + \"\\\\)$\"),\n reRgbPercent = new RegExp(\"^rgb\\\\(\" + [reP, reP, reP] + \"\\\\)$\"),\n reRgbaInteger = new RegExp(\"^rgba\\\\(\" + [reI, reI, reI, reN] + \"\\\\)$\"),\n reRgbaPercent = new RegExp(\"^rgba\\\\(\" + [reP, reP, reP, reN] + \"\\\\)$\"),\n reHslPercent = new RegExp(\"^hsl\\\\(\" + [reN, reP, reP] + \"\\\\)$\"),\n reHslaPercent = new RegExp(\"^hsla\\\\(\" + [reN, reP, reP, reN] + \"\\\\)$\");\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy: function(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable: function() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb: function() {\n return this;\n },\n displayable: function() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return \"#\" + hex(this.r) + hex(this.g) + hex(this.b);\n}\n\nfunction rgb_formatRgb() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"rgb(\" : \"rgba(\")\n + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.b) || 0))\n + (a === 1 ? \")\" : \", \" + a + \")\");\n}\n\nfunction hex(value) {\n value = Math.max(0, Math.min(255, Math.round(value) || 0));\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n displayable: function() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl: function() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"hsl(\" : \"hsla(\")\n + (this.h || 0) + \", \"\n + (this.s || 0) * 100 + \"%, \"\n + (this.l || 0) * 100 + \"%\"\n + (a === 1 ? \")\" : \", \" + a + \")\");\n }\n}));\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n","import { __spreadArray, __read } from 'tslib';\nimport { isNumberEqual } from '@antv/util';\nimport { vec2 } from 'gl-matrix';\n\nfunction distance(x1, y1, x2, y2) {\n var dx = x1 - x2;\n var dy = y1 - y2;\n return Math.sqrt(dx * dx + dy * dy);\n}\nfunction getBBoxByArray(xArr, yArr) {\n var minX = Math.min.apply(Math, __spreadArray([], __read(xArr), false));\n var minY = Math.min.apply(Math, __spreadArray([], __read(yArr), false));\n var maxX = Math.max.apply(Math, __spreadArray([], __read(xArr), false));\n var maxY = Math.max.apply(Math, __spreadArray([], __read(yArr), false));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n}\nfunction piMod(angle) {\n return (angle + Math.PI * 2) % (Math.PI * 2);\n}\n\nfunction copysign(v1, v2) {\n var absv = Math.abs(v1);\n return v2 > 0 ? absv : absv * -1;\n}\nfunction nearestPoint$4(x, y, rx, ry, x0, y0) {\n var a = rx;\n var b = ry;\n // 假如椭圆半径为0则返回圆心\n if (a === 0 || b === 0) {\n return {\n x: x,\n y: y,\n };\n }\n // 转换成 0, 0 为中心的椭圆计算\n var relativeX = x0 - x;\n var relativeY = y0 - y;\n var px = Math.abs(relativeX);\n var py = Math.abs(relativeY);\n var squareA = a * a;\n var squareB = b * b;\n // const angle0 = Math.atan2(relativeY, relativeX);\n var t = Math.PI / 4;\n var nearestX = 0; // 椭圆上的任一点\n var nearestY = 0;\n // 迭代 4 次\n for (var i = 0; i < 4; i++) {\n nearestX = a * Math.cos(t);\n nearestY = b * Math.sin(t);\n var ex = ((squareA - squareB) * Math.pow(Math.cos(t), 3)) / a;\n var ey = ((squareB - squareA) * Math.pow(Math.sin(t), 3)) / b;\n var rx1 = nearestX - ex;\n var ry1 = nearestY - ey;\n var qx = px - ex;\n var qy = py - ey;\n var r = Math.hypot(ry1, rx1);\n var q = Math.hypot(qy, qx);\n var delta_c = r * Math.asin((rx1 * qy - ry1 * qx) / (r * q));\n var delta_t = delta_c /\n Math.sqrt(squareA + squareB - nearestX * nearestX - nearestY * nearestY);\n t += delta_t;\n t = Math.min(Math.PI / 2, Math.max(0, t));\n }\n return {\n x: x + copysign(nearestX, relativeX),\n y: y + copysign(nearestY, relativeY),\n };\n}\n\n// 偏导数 x\nfunction derivativeXAt(cx, cy, rx, ry, xRotation, startAngle, endAngle, angle) {\n return (-1 * rx * Math.cos(xRotation) * Math.sin(angle) -\n ry * Math.sin(xRotation) * Math.cos(angle));\n}\n// 偏导数 y\nfunction derivativeYAt(cx, cy, rx, ry, xRotation, startAngle, endAngle, angle) {\n return (-1 * rx * Math.sin(xRotation) * Math.sin(angle) +\n ry * Math.cos(xRotation) * Math.cos(angle));\n}\n// x 的极值\nfunction xExtrema(rx, ry, xRotation) {\n return Math.atan((-ry / rx) * Math.tan(xRotation));\n}\n// y 的极值\nfunction yExtrema(rx, ry, xRotation) {\n return Math.atan(ry / (rx * Math.tan(xRotation)));\n}\n// 根据角度求 x 坐标\nfunction xAt(cx, cy, rx, ry, xRotation, angle) {\n return (rx * Math.cos(xRotation) * Math.cos(angle) -\n ry * Math.sin(xRotation) * Math.sin(angle) +\n cx);\n}\n// 根据角度求 y 坐标\nfunction yAt(cx, cy, rx, ry, xRotation, angle) {\n return (rx * Math.sin(xRotation) * Math.cos(angle) +\n ry * Math.cos(xRotation) * Math.sin(angle) +\n cy);\n}\n// 获取点在椭圆上的角度\nfunction getAngle(rx, ry, x0, y0) {\n var angle = Math.atan2(y0 * rx, x0 * ry);\n // 转换到 0 - 2PI 内\n return (angle + Math.PI * 2) % (Math.PI * 2);\n}\n// 根据角度获取,x,y\nfunction getPoint(rx, ry, angle) {\n return {\n x: rx * Math.cos(angle),\n y: ry * Math.sin(angle),\n };\n}\n// 旋转\nfunction rotate(x, y, angle) {\n var cos = Math.cos(angle);\n var sin = Math.sin(angle);\n return [x * cos - y * sin, x * sin + y * cos];\n}\nfunction box$5(cx, cy, rx, ry, xRotation, startAngle, endAngle) {\n var xDim = xExtrema(rx, ry, xRotation);\n var minX = Infinity;\n var maxX = -Infinity;\n var xs = [startAngle, endAngle];\n for (var i = -Math.PI * 2; i <= Math.PI * 2; i += Math.PI) {\n var xAngle = xDim + i;\n if (startAngle < endAngle) {\n if (startAngle < xAngle && xAngle < endAngle) {\n xs.push(xAngle);\n }\n }\n else {\n if (endAngle < xAngle && xAngle < startAngle) {\n xs.push(xAngle);\n }\n }\n }\n for (var i = 0; i < xs.length; i++) {\n var x = xAt(cx, cy, rx, ry, xRotation, xs[i]);\n if (x < minX) {\n minX = x;\n }\n if (x > maxX) {\n maxX = x;\n }\n }\n var yDim = yExtrema(rx, ry, xRotation);\n var minY = Infinity;\n var maxY = -Infinity;\n var ys = [startAngle, endAngle];\n for (var i = -Math.PI * 2; i <= Math.PI * 2; i += Math.PI) {\n var yAngle = yDim + i;\n if (startAngle < endAngle) {\n if (startAngle < yAngle && yAngle < endAngle) {\n ys.push(yAngle);\n }\n }\n else {\n if (endAngle < yAngle && yAngle < startAngle) {\n ys.push(yAngle);\n }\n }\n }\n for (var i = 0; i < ys.length; i++) {\n var y = yAt(cx, cy, rx, ry, xRotation, ys[i]);\n if (y < minY) {\n minY = y;\n }\n if (y > maxY) {\n maxY = y;\n }\n }\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n}\nfunction nearestPoint$3(cx, cy, rx, ry, xRotation, startAngle, endAngle, x0, y0) {\n // 将最近距离问题转换成到椭圆中心 0,0 没有旋转的椭圆问题\n var relativeVector = rotate(x0 - cx, y0 - cy, -xRotation);\n var _a = __read(relativeVector, 2), x1 = _a[0], y1 = _a[1];\n // 计算点到椭圆的最近的点\n var relativePoint = nearestPoint$4(0, 0, rx, ry, x1, y1);\n // 获取点在椭圆上的角度\n var angle = getAngle(rx, ry, relativePoint.x, relativePoint.y);\n // 点没有在圆弧上\n if (angle < startAngle) {\n // 小于起始圆弧\n relativePoint = getPoint(rx, ry, startAngle);\n }\n else if (angle > endAngle) {\n // 大于结束圆弧\n relativePoint = getPoint(rx, ry, endAngle);\n }\n // 旋转到 xRotation 的角度\n var vector = rotate(relativePoint.x, relativePoint.y, xRotation);\n return {\n x: vector[0] + cx,\n y: vector[1] + cy,\n };\n}\nfunction tangentAngle$4(cx, cy, rx, ry, xRotation, startAngle, endAngle, t) {\n var angle = (endAngle - startAngle) * t + startAngle;\n var dx = derivativeXAt(cx, cy, rx, ry, xRotation, startAngle, endAngle, angle);\n var dy = derivativeYAt(cx, cy, rx, ry, xRotation, startAngle, endAngle, angle);\n return piMod(Math.atan2(dy, dx));\n}\n\nvar EPSILON = 0.0001;\n/**\n * 使用牛顿切割法求最近的点\n * @param {number[]} xArr 点的 x 数组\n * @param {number[]} yArr 点的 y 数组\n * @param {number} x 指定的点 x\n * @param {number} y 指定的点 y\n * @param {Function} tCallback 差值函数\n */\nfunction nearestPoint$2(xArr, yArr, x, y, tCallback, length) {\n var t = -1;\n var d = Infinity;\n var v0 = [x, y];\n var segNum = 20;\n if (length && length > 200) {\n segNum = length / 10;\n }\n var increaseRate = 1 / segNum;\n var interval = increaseRate / 10;\n for (var i = 0; i <= segNum; i++) {\n var _t = i * increaseRate;\n var v1 = [\n tCallback.apply(void 0, __spreadArray([], __read(xArr.concat([_t])), false)),\n tCallback.apply(void 0, __spreadArray([], __read(yArr.concat([_t])), false)),\n ];\n var d1 = distance(v0[0], v0[1], v1[0], v1[1]);\n if (d1 < d) {\n t = _t;\n d = d1;\n }\n }\n // 提前终止\n if (t === 0) {\n return {\n x: xArr[0],\n y: yArr[0],\n };\n }\n if (t === 1) {\n var count = xArr.length;\n return {\n x: xArr[count - 1],\n y: yArr[count - 1],\n };\n }\n d = Infinity;\n for (var i = 0; i < 32; i++) {\n if (interval < EPSILON) {\n break;\n }\n var prev = t - interval;\n var next = t + interval;\n var v1 = [\n tCallback.apply(void 0, __spreadArray([], __read(xArr.concat([prev])), false)),\n tCallback.apply(void 0, __spreadArray([], __read(yArr.concat([prev])), false)),\n ];\n var d1 = distance(v0[0], v0[1], v1[0], v1[1]);\n if (prev >= 0 && d1 < d) {\n t = prev;\n d = d1;\n }\n else {\n var v2 = [\n tCallback.apply(void 0, __spreadArray([], __read(xArr.concat([next])), false)),\n tCallback.apply(void 0, __spreadArray([], __read(yArr.concat([next])), false)),\n ];\n var d2 = distance(v0[0], v0[1], v2[0], v2[1]);\n if (next <= 1 && d2 < d) {\n t = next;\n d = d2;\n }\n else {\n interval *= 0.5;\n }\n }\n }\n return {\n x: tCallback.apply(void 0, __spreadArray([], __read(xArr.concat([t])), false)),\n y: tCallback.apply(void 0, __spreadArray([], __read(yArr.concat([t])), false)),\n };\n}\n// 近似求解 https://community.khronos.org/t/3d-cubic-bezier-segment-length/62363/2\nfunction snapLength(xArr, yArr) {\n var totalLength = 0;\n var count = xArr.length;\n for (var i = 0; i < count; i++) {\n var x = xArr[i];\n var y = yArr[i];\n var nextX = xArr[(i + 1) % count];\n var nextY = yArr[(i + 1) % count];\n totalLength += distance(x, y, nextX, nextY);\n }\n return totalLength / 2;\n}\n\nfunction box$4(x1, y1, x2, y2) {\n return getBBoxByArray([x1, x2], [y1, y2]);\n}\nfunction length$4(x1, y1, x2, y2) {\n return distance(x1, y1, x2, y2);\n}\nfunction pointAt$3(x1, y1, x2, y2, t) {\n return {\n x: (1 - t) * x1 + t * x2,\n y: (1 - t) * y1 + t * y2,\n };\n}\nfunction pointDistance$4(x1, y1, x2, y2, x, y) {\n // 投影距离 x1, y1 的向量,假设 p, p1, p2 三个点,投影点为 a\n // p1a = p1p.p1p2/|p1p2| * (p1p 的单位向量)\n var cross = (x2 - x1) * (x - x1) + (y2 - y1) * (y - y1);\n if (cross < 0) {\n return distance(x1, y1, x, y);\n }\n var lengthSquare = (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);\n if (cross > lengthSquare) {\n return distance(x2, y2, x, y);\n }\n return pointToLine(x1, y1, x2, y2, x, y);\n}\nfunction pointToLine(x1, y1, x2, y2, x, y) {\n var d = [x2 - x1, y2 - y1];\n // 如果端点相等,则判定点到点的距离\n if (vec2.exactEquals(d, [0, 0])) {\n return Math.sqrt((x - x1) * (x - x1) + (y - y1) * (y - y1));\n }\n var u = [-d[1], d[0]];\n vec2.normalize(u, u);\n var a = [x - x1, y - y1];\n return Math.abs(vec2.dot(a, u));\n}\nfunction tangentAngle$3(x1, y1, x2, y2) {\n return Math.atan2(y2 - y1, x2 - x1);\n}\n\nfunction cubicAt(p0, p1, p2, p3, t) {\n var onet = 1 - t; // t * t * t 的性能大概是 Math.pow(t, 3) 的三倍\n return (onet * onet * onet * p0 +\n 3 * p1 * t * onet * onet +\n 3 * p2 * t * t * onet +\n p3 * t * t * t);\n}\nfunction derivativeAt(p0, p1, p2, p3, t) {\n var onet = 1 - t;\n return (3 * (onet * onet * (p1 - p0) + 2 * onet * t * (p2 - p1) + t * t * (p3 - p2)));\n}\nfunction extrema$1(p0, p1, p2, p3) {\n var a = -3 * p0 + 9 * p1 - 9 * p2 + 3 * p3;\n var b = 6 * p0 - 12 * p1 + 6 * p2;\n var c = 3 * p1 - 3 * p0;\n var extremas = [];\n var t1;\n var t2;\n var discSqrt;\n if (isNumberEqual(a, 0)) {\n if (!isNumberEqual(b, 0)) {\n t1 = -c / b;\n if (t1 >= 0 && t1 <= 1) {\n extremas.push(t1);\n }\n }\n }\n else {\n var disc = b * b - 4 * a * c;\n if (isNumberEqual(disc, 0)) {\n extremas.push(-b / (2 * a));\n }\n else if (disc > 0) {\n discSqrt = Math.sqrt(disc);\n t1 = (-b + discSqrt) / (2 * a);\n t2 = (-b - discSqrt) / (2 * a);\n if (t1 >= 0 && t1 <= 1) {\n extremas.push(t1);\n }\n if (t2 >= 0 && t2 <= 1) {\n extremas.push(t2);\n }\n }\n }\n return extremas;\n}\n// 分割贝塞尔曲线\nfunction divideCubic(x1, y1, x2, y2, x3, y3, x4, y4, t) {\n // 划分点\n var xt = cubicAt(x1, x2, x3, x4, t);\n var yt = cubicAt(y1, y2, y3, y4, t);\n // 计算两点之间的差值点\n var c1 = pointAt$3(x1, y1, x2, y2, t);\n var c2 = pointAt$3(x2, y2, x3, y3, t);\n var c3 = pointAt$3(x3, y3, x4, y4, t);\n var c12 = pointAt$3(c1.x, c1.y, c2.x, c2.y, t);\n var c23 = pointAt$3(c2.x, c2.y, c3.x, c3.y, t);\n return [\n [x1, y1, c1.x, c1.y, c12.x, c12.y, xt, yt],\n [xt, yt, c23.x, c23.y, c3.x, c3.y, x4, y4],\n ];\n}\n// 使用迭代法取贝塞尔曲线的长度,二阶和三阶分开写,更清晰和便于调试\nfunction cubicLength(x1, y1, x2, y2, x3, y3, x4, y4, iterationCount) {\n if (iterationCount === 0) {\n return snapLength([x1, x2, x3, x4], [y1, y2, y3, y4]);\n }\n var cubics = divideCubic(x1, y1, x2, y2, x3, y3, x4, y4, 0.5);\n var left = __spreadArray(__spreadArray([], __read(cubics[0]), false), [iterationCount - 1], false);\n var right = __spreadArray(__spreadArray([], __read(cubics[1]), false), [iterationCount - 1], false);\n return cubicLength.apply(void 0, __spreadArray([], __read(left), false)) + cubicLength.apply(void 0, __spreadArray([], __read(right), false));\n}\nfunction box$3(x1, y1, x2, y2, x3, y3, x4, y4) {\n var xArr = [x1, x4];\n var yArr = [y1, y4];\n var xExtrema = extrema$1(x1, x2, x3, x4);\n var yExtrema = extrema$1(y1, y2, y3, y4);\n for (var i = 0; i < xExtrema.length; i++) {\n xArr.push(cubicAt(x1, x2, x3, x4, xExtrema[i]));\n }\n for (var i = 0; i < yExtrema.length; i++) {\n yArr.push(cubicAt(y1, y2, y3, y4, yExtrema[i]));\n }\n return getBBoxByArray(xArr, yArr);\n}\nfunction length$3(x1, y1, x2, y2, x3, y3, x4, y4) {\n // 迭代三次,划分成 8 段求长度\n return cubicLength(x1, y1, x2, y2, x3, y3, x4, y4, 3);\n}\nfunction nearestPoint$1(x1, y1, x2, y2, x3, y3, x4, y4, x0, y0, length) {\n return nearestPoint$2([x1, x2, x3, x4], [y1, y2, y3, y4], x0, y0, cubicAt, length);\n}\nfunction pointDistance$3(x1, y1, x2, y2, x3, y3, x4, y4, x0, y0, length) {\n var point = nearestPoint$1(x1, y1, x2, y2, x3, y3, x4, y4, x0, y0, length);\n return distance(point.x, point.y, x0, y0);\n}\nfunction pointAt$2(x1, y1, x2, y2, x3, y3, x4, y4, t) {\n return {\n x: cubicAt(x1, x2, x3, x4, t),\n y: cubicAt(y1, y2, y3, y4, t),\n };\n}\nfunction tangentAngle$2(x1, y1, x2, y2, x3, y3, x4, y4, t) {\n var dx = derivativeAt(x1, x2, x3, x4, t);\n var dy = derivativeAt(y1, y2, y3, y4, t);\n return piMod(Math.atan2(dy, dx));\n}\n\nfunction analyzePoints(points) {\n // 计算每段的长度和总的长度\n var totalLength = 0;\n var segments = [];\n for (var i = 0; i < points.length - 1; i++) {\n var from = points[i];\n var to = points[i + 1];\n var length_1 = distance(from[0], from[1], to[0], to[1]);\n var seg = {\n from: from,\n to: to,\n length: length_1,\n };\n segments.push(seg);\n totalLength += length_1;\n }\n return { segments: segments, totalLength: totalLength };\n}\nfunction lengthOfSegment(points) {\n if (points.length < 2) {\n return 0;\n }\n var totalLength = 0;\n for (var i = 0; i < points.length - 1; i++) {\n var from = points[i];\n var to = points[i + 1];\n totalLength += distance(from[0], from[1], to[0], to[1]);\n }\n return totalLength;\n}\n/**\n * 按照比例在数据片段中获取点\n * @param {array} points 点的集合\n * @param {number} t 百分比 0-1\n * @return {object} 点的坐标\n */\nfunction pointAtSegments(points, t) {\n // 边界判断\n if (t > 1 || t < 0 || points.length < 2) {\n return null;\n }\n var _a = analyzePoints(points), segments = _a.segments, totalLength = _a.totalLength;\n // 多个点有可能重合\n if (totalLength === 0) {\n return {\n x: points[0][0],\n y: points[0][1],\n };\n }\n // 计算比例\n var startRatio = 0;\n var point = null;\n for (var i = 0; i < segments.length; i++) {\n var seg = segments[i];\n var from = seg.from, to = seg.to;\n var currentRatio = seg.length / totalLength;\n if (t >= startRatio && t <= startRatio + currentRatio) {\n var localRatio = (t - startRatio) / currentRatio;\n point = pointAt$3(from[0], from[1], to[0], to[1], localRatio);\n break;\n }\n startRatio += currentRatio;\n }\n return point;\n}\n/**\n * 按照比例在数据片段中获取切线的角度\n * @param {array} points 点的集合\n * @param {number} t 百分比 0-1\n */\nfunction angleAtSegments(points, t) {\n // 边界判断\n if (t > 1 || t < 0 || points.length < 2) {\n return 0;\n }\n var _a = analyzePoints(points), segments = _a.segments, totalLength = _a.totalLength;\n // 计算比例\n var startRatio = 0;\n var angle = 0;\n for (var i = 0; i < segments.length; i++) {\n var seg = segments[i];\n var from = seg.from, to = seg.to;\n var currentRatio = seg.length / totalLength;\n if (t >= startRatio && t <= startRatio + currentRatio) {\n angle = Math.atan2(to[1] - from[1], to[0] - from[0]);\n break;\n }\n startRatio += currentRatio;\n }\n return angle;\n}\nfunction distanceAtSegment(points, x, y) {\n var minDistance = Infinity;\n for (var i = 0; i < points.length - 1; i++) {\n var point = points[i];\n var nextPoint = points[i + 1];\n var distance_1 = pointDistance$4(point[0], point[1], nextPoint[0], nextPoint[1], x, y);\n if (distance_1 < minDistance) {\n minDistance = distance_1;\n }\n }\n return minDistance;\n}\n\nfunction box$2(points) {\n var xArr = [];\n var yArr = [];\n for (var i = 0; i < points.length; i++) {\n var point = points[i];\n xArr.push(point[0]);\n yArr.push(point[1]);\n }\n return getBBoxByArray(xArr, yArr);\n}\nfunction length$2(points) {\n return lengthOfSegment(points);\n}\nfunction pointAt$1(points, t) {\n return pointAtSegments(points, t);\n}\nfunction pointDistance$2(points, x, y) {\n return distanceAtSegment(points, x, y);\n}\nfunction tangentAngle$1(points, t) {\n return angleAtSegments(points, t);\n}\n\nfunction getAllPoints(points) {\n var tmp = points.slice(0);\n if (points.length) {\n tmp.push(points[0]);\n }\n return tmp;\n}\nfunction box$1(points) {\n return box$2(points);\n}\nfunction length$1(points) {\n return lengthOfSegment(getAllPoints(points));\n}\nfunction pointAt(points, t) {\n return pointAtSegments(getAllPoints(points), t);\n}\nfunction pointDistance$1(points, x, y) {\n return distanceAtSegment(getAllPoints(points), x, y);\n}\nfunction tangentAngle(points, t) {\n return angleAtSegments(getAllPoints(points), t);\n}\n\n// 差值公式\nfunction quadraticAt(p0, p1, p2, t) {\n var onet = 1 - t;\n return onet * onet * p0 + 2 * t * onet * p1 + t * t * p2;\n}\n// 求极值\nfunction extrema(p0, p1, p2) {\n var a = p0 + p2 - 2 * p1;\n if (isNumberEqual(a, 0)) {\n return [0.5];\n }\n var rst = (p0 - p1) / a;\n if (rst <= 1 && rst >= 0) {\n return [rst];\n }\n return [];\n}\n// 分割贝塞尔曲线\nfunction divideQuadratic(x1, y1, x2, y2, x3, y3, t) {\n // 划分点\n var xt = quadraticAt(x1, x2, x3, t);\n var yt = quadraticAt(y1, y2, y3, t);\n // 分割的第一条曲线的控制点\n var controlPoint1 = pointAt$3(x1, y1, x2, y2, t);\n // 分割的第二条曲线的控制点\n var controlPoint2 = pointAt$3(x2, y2, x3, y3, t);\n return [\n [x1, y1, controlPoint1.x, controlPoint1.y, xt, yt],\n [xt, yt, controlPoint2.x, controlPoint2.y, x3, y3],\n ];\n}\n// 使用迭代法取贝塞尔曲线的长度\nfunction quadraticLength(x1, y1, x2, y2, x3, y3, iterationCount) {\n if (iterationCount === 0) {\n return ((distance(x1, y1, x2, y2) +\n distance(x2, y2, x3, y3) +\n distance(x1, y1, x3, y3)) /\n 2);\n }\n var quadratics = divideQuadratic(x1, y1, x2, y2, x3, y3, 0.5);\n var left = quadratics[0];\n var right = quadratics[1];\n left.push(iterationCount - 1);\n right.push(iterationCount - 1);\n return quadraticLength.apply(void 0, __spreadArray([], __read(left), false)) + quadraticLength.apply(void 0, __spreadArray([], __read(right), false));\n}\nfunction box(x1, y1, x2, y2, x3, y3) {\n var xExtrema = extrema(x1, x2, x3)[0];\n var yExtrema = extrema(y1, y2, y3)[0];\n // 控制点不加入 box 的计算\n var xArr = [x1, x3];\n var yArr = [y1, y3];\n if (xExtrema !== undefined) {\n xArr.push(quadraticAt(x1, x2, x3, xExtrema));\n }\n if (yExtrema !== undefined) {\n yArr.push(quadraticAt(y1, y2, y3, yExtrema));\n }\n return getBBoxByArray(xArr, yArr);\n}\nfunction length(x1, y1, x2, y2, x3, y3) {\n return quadraticLength(x1, y1, x2, y2, x3, y3, 3);\n}\nfunction nearestPoint(x1, y1, x2, y2, x3, y3, x0, y0) {\n return nearestPoint$2([x1, x2, x3], [y1, y2, y3], x0, y0, quadraticAt);\n}\nfunction pointDistance(x1, y1, x2, y2, x3, y3, x0, y0) {\n var point = nearestPoint(x1, y1, x2, y2, x3, y3, x0, y0);\n return distance(point.x, point.y, x0, y0);\n}\n\nexport { box$5 as arcBox, nearestPoint$3 as arcNearestPoint, tangentAngle$4 as arcTangentAngle, box$3 as cubicBox, length$3 as cubicLength, nearestPoint$1 as cubicNearestPoint, pointAt$2 as cubicPointAt, pointDistance$3 as cubicPointDistance, tangentAngle$2 as cubicTangentAngle, distance, box$4 as lineBox, length$4 as lineLength, pointAt$3 as linePointAt, pointDistance$4 as linePointDistance, pointToLine as linePointToLine, tangentAngle$3 as lineTangentAngle, box$1 as polygonBox, length$1 as polygonLength, pointAt as polygonPointAt, pointDistance$1 as polygonPointDistance, tangentAngle as polygonTangentAngle, box$2 as polylineBox, length$2 as polylineLength, pointAt$1 as polylinePointAt, pointDistance$2 as polylinePointDistance, tangentAngle$1 as polylineTangentAngle, box as quadBox, length as quadLength, nearestPoint as quadNearestPoint, pointDistance as quadPointDistance };\n//# sourceMappingURL=index.esm.js.map\n","import { __assign, __read, __extends, __spreadArray, __awaiter, __generator, __values, __rest } from 'tslib';\nimport EventEmitter from 'eventemitter3';\nimport { mat4, vec4, vec3, mat3, quat as quat$1, vec2 } from 'gl-matrix';\nimport { isNumber, distanceSquareRoot, isString, isNil, clamp, getTotalLength, min, max, isNumberEqual, mod, normalizePath, path2Curve, equalizeSegments, getDrawDirection, reverseCurve, clonePath, getRotatedCurve, isArray, isBoolean, isObject, isUndefined, getPointAtLength } from '@antv/util';\nimport * as d3 from 'd3-color';\nimport { arcBox, cubicBox, quadBox, polylineLength, lineLength, linePointAt } from '@antv/g-math';\n\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nvar rbush = {exports: {}};\n\n(function (module, exports) {\n(function (global, factory) {\nmodule.exports = factory() ;\n}(commonjsGlobal, function () {\nfunction quickselect(arr, k, left, right, compare) {\n quickselectStep(arr, k, left || 0, right || (arr.length - 1), compare || defaultCompare);\n}\n\nfunction quickselectStep(arr, k, left, right, compare) {\n\n while (right > left) {\n if (right - left > 600) {\n var n = right - left + 1;\n var m = k - left + 1;\n var z = Math.log(n);\n var s = 0.5 * Math.exp(2 * z / 3);\n var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n var newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselectStep(arr, k, newLeft, newRight, compare);\n }\n\n var t = arr[k];\n var i = left;\n var j = right;\n\n swap(arr, left, k);\n if (compare(arr[right], t) > 0) { swap(arr, left, right); }\n\n while (i < j) {\n swap(arr, i, j);\n i++;\n j--;\n while (compare(arr[i], t) < 0) { i++; }\n while (compare(arr[j], t) > 0) { j--; }\n }\n\n if (compare(arr[left], t) === 0) { swap(arr, left, j); }\n else {\n j++;\n swap(arr, j, right);\n }\n\n if (j <= k) { left = j + 1; }\n if (k <= j) { right = j - 1; }\n }\n}\n\nfunction swap(arr, i, j) {\n var tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n}\n\nfunction defaultCompare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\nvar RBush = function RBush(maxEntries) {\n if ( maxEntries === void 0 ) maxEntries = 9;\n\n // max entries in a node is 9 by default; min node fill is 40% for best performance\n this._maxEntries = Math.max(4, maxEntries);\n this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4));\n this.clear();\n};\n\nRBush.prototype.all = function all () {\n return this._all(this.data, []);\n};\n\nRBush.prototype.search = function search (bbox) {\n var node = this.data;\n var result = [];\n\n if (!intersects(bbox, node)) { return result; }\n\n var toBBox = this.toBBox;\n var nodesToSearch = [];\n\n while (node) {\n for (var i = 0; i < node.children.length; i++) {\n var child = node.children[i];\n var childBBox = node.leaf ? toBBox(child) : child;\n\n if (intersects(bbox, childBBox)) {\n if (node.leaf) { result.push(child); }\n else if (contains(bbox, childBBox)) { this._all(child, result); }\n else { nodesToSearch.push(child); }\n }\n }\n node = nodesToSearch.pop();\n }\n\n return result;\n};\n\nRBush.prototype.collides = function collides (bbox) {\n var node = this.data;\n\n if (!intersects(bbox, node)) { return false; }\n\n var nodesToSearch = [];\n while (node) {\n for (var i = 0; i < node.children.length; i++) {\n var child = node.children[i];\n var childBBox = node.leaf ? this.toBBox(child) : child;\n\n if (intersects(bbox, childBBox)) {\n if (node.leaf || contains(bbox, childBBox)) { return true; }\n nodesToSearch.push(child);\n }\n }\n node = nodesToSearch.pop();\n }\n\n return false;\n};\n\nRBush.prototype.load = function load (data) {\n if (!(data && data.length)) { return this; }\n\n if (data.length < this._minEntries) {\n for (var i = 0; i < data.length; i++) {\n this.insert(data[i]);\n }\n return this;\n }\n\n // recursively build the tree with the given data from scratch using OMT algorithm\n var node = this._build(data.slice(), 0, data.length - 1, 0);\n\n if (!this.data.children.length) {\n // save as is if tree is empty\n this.data = node;\n\n } else if (this.data.height === node.height) {\n // split root if trees have the same height\n this._splitRoot(this.data, node);\n\n } else {\n if (this.data.height < node.height) {\n // swap trees if inserted one is bigger\n var tmpNode = this.data;\n this.data = node;\n node = tmpNode;\n }\n\n // insert the small tree into the large tree at appropriate level\n this._insert(node, this.data.height - node.height - 1, true);\n }\n\n return this;\n};\n\nRBush.prototype.insert = function insert (item) {\n if (item) { this._insert(item, this.data.height - 1); }\n return this;\n};\n\nRBush.prototype.clear = function clear () {\n this.data = createNode([]);\n return this;\n};\n\nRBush.prototype.remove = function remove (item, equalsFn) {\n if (!item) { return this; }\n\n var node = this.data;\n var bbox = this.toBBox(item);\n var path = [];\n var indexes = [];\n var i, parent, goingUp;\n\n // depth-first iterative tree traversal\n while (node || path.length) {\n\n if (!node) { // go up\n node = path.pop();\n parent = path[path.length - 1];\n i = indexes.pop();\n goingUp = true;\n }\n\n if (node.leaf) { // check current node\n var index = findItem(item, node.children, equalsFn);\n\n if (index !== -1) {\n // item found, remove the item and condense tree upwards\n node.children.splice(index, 1);\n path.push(node);\n this._condense(path);\n return this;\n }\n }\n\n if (!goingUp && !node.leaf && contains(node, bbox)) { // go down\n path.push(node);\n indexes.push(i);\n i = 0;\n parent = node;\n node = node.children[0];\n\n } else if (parent) { // go right\n i++;\n node = parent.children[i];\n goingUp = false;\n\n } else { node = null; } // nothing found\n }\n\n return this;\n};\n\nRBush.prototype.toBBox = function toBBox (item) { return item; };\n\nRBush.prototype.compareMinX = function compareMinX (a, b) { return a.minX - b.minX; };\nRBush.prototype.compareMinY = function compareMinY (a, b) { return a.minY - b.minY; };\n\nRBush.prototype.toJSON = function toJSON () { return this.data; };\n\nRBush.prototype.fromJSON = function fromJSON (data) {\n this.data = data;\n return this;\n};\n\nRBush.prototype._all = function _all (node, result) {\n var nodesToSearch = [];\n while (node) {\n if (node.leaf) { result.push.apply(result, node.children); }\n else { nodesToSearch.push.apply(nodesToSearch, node.children); }\n\n node = nodesToSearch.pop();\n }\n return result;\n};\n\nRBush.prototype._build = function _build (items, left, right, height) {\n\n var N = right - left + 1;\n var M = this._maxEntries;\n var node;\n\n if (N <= M) {\n // reached leaf level; return leaf\n node = createNode(items.slice(left, right + 1));\n calcBBox(node, this.toBBox);\n return node;\n }\n\n if (!height) {\n // target height of the bulk-loaded tree\n height = Math.ceil(Math.log(N) / Math.log(M));\n\n // target number of root entries to maximize storage utilization\n M = Math.ceil(N / Math.pow(M, height - 1));\n }\n\n node = createNode([]);\n node.leaf = false;\n node.height = height;\n\n // split the items into M mostly square tiles\n\n var N2 = Math.ceil(N / M);\n var N1 = N2 * Math.ceil(Math.sqrt(M));\n\n multiSelect(items, left, right, N1, this.compareMinX);\n\n for (var i = left; i <= right; i += N1) {\n\n var right2 = Math.min(i + N1 - 1, right);\n\n multiSelect(items, i, right2, N2, this.compareMinY);\n\n for (var j = i; j <= right2; j += N2) {\n\n var right3 = Math.min(j + N2 - 1, right2);\n\n // pack each entry recursively\n node.children.push(this._build(items, j, right3, height - 1));\n }\n }\n\n calcBBox(node, this.toBBox);\n\n return node;\n};\n\nRBush.prototype._chooseSubtree = function _chooseSubtree (bbox, node, level, path) {\n while (true) {\n path.push(node);\n\n if (node.leaf || path.length - 1 === level) { break; }\n\n var minArea = Infinity;\n var minEnlargement = Infinity;\n var targetNode = (void 0);\n\n for (var i = 0; i < node.children.length; i++) {\n var child = node.children[i];\n var area = bboxArea(child);\n var enlargement = enlargedArea(bbox, child) - area;\n\n // choose entry with the least area enlargement\n if (enlargement < minEnlargement) {\n minEnlargement = enlargement;\n minArea = area < minArea ? area : minArea;\n targetNode = child;\n\n } else if (enlargement === minEnlargement) {\n // otherwise choose one with the smallest area\n if (area < minArea) {\n minArea = area;\n targetNode = child;\n }\n }\n }\n\n node = targetNode || node.children[0];\n }\n\n return node;\n};\n\nRBush.prototype._insert = function _insert (item, level, isNode) {\n var bbox = isNode ? item : this.toBBox(item);\n var insertPath = [];\n\n // find the best node for accommodating the item, saving all nodes along the path too\n var node = this._chooseSubtree(bbox, this.data, level, insertPath);\n\n // put the item into the node\n node.children.push(item);\n extend(node, bbox);\n\n // split on node overflow; propagate upwards if necessary\n while (level >= 0) {\n if (insertPath[level].children.length > this._maxEntries) {\n this._split(insertPath, level);\n level--;\n } else { break; }\n }\n\n // adjust bboxes along the insertion path\n this._adjustParentBBoxes(bbox, insertPath, level);\n};\n\n// split overflowed node into two\nRBush.prototype._split = function _split (insertPath, level) {\n var node = insertPath[level];\n var M = node.children.length;\n var m = this._minEntries;\n\n this._chooseSplitAxis(node, m, M);\n\n var splitIndex = this._chooseSplitIndex(node, m, M);\n\n var newNode = createNode(node.children.splice(splitIndex, node.children.length - splitIndex));\n newNode.height = node.height;\n newNode.leaf = node.leaf;\n\n calcBBox(node, this.toBBox);\n calcBBox(newNode, this.toBBox);\n\n if (level) { insertPath[level - 1].children.push(newNode); }\n else { this._splitRoot(node, newNode); }\n};\n\nRBush.prototype._splitRoot = function _splitRoot (node, newNode) {\n // split root node\n this.data = createNode([node, newNode]);\n this.data.height = node.height + 1;\n this.data.leaf = false;\n calcBBox(this.data, this.toBBox);\n};\n\nRBush.prototype._chooseSplitIndex = function _chooseSplitIndex (node, m, M) {\n var index;\n var minOverlap = Infinity;\n var minArea = Infinity;\n\n for (var i = m; i <= M - m; i++) {\n var bbox1 = distBBox(node, 0, i, this.toBBox);\n var bbox2 = distBBox(node, i, M, this.toBBox);\n\n var overlap = intersectionArea(bbox1, bbox2);\n var area = bboxArea(bbox1) + bboxArea(bbox2);\n\n // choose distribution with minimum overlap\n if (overlap < minOverlap) {\n minOverlap = overlap;\n index = i;\n\n minArea = area < minArea ? area : minArea;\n\n } else if (overlap === minOverlap) {\n // otherwise choose distribution with minimum area\n if (area < minArea) {\n minArea = area;\n index = i;\n }\n }\n }\n\n return index || M - m;\n};\n\n// sorts node children by the best axis for split\nRBush.prototype._chooseSplitAxis = function _chooseSplitAxis (node, m, M) {\n var compareMinX = node.leaf ? this.compareMinX : compareNodeMinX;\n var compareMinY = node.leaf ? this.compareMinY : compareNodeMinY;\n var xMargin = this._allDistMargin(node, m, M, compareMinX);\n var yMargin = this._allDistMargin(node, m, M, compareMinY);\n\n // if total distributions margin value is minimal for x, sort by minX,\n // otherwise it's already sorted by minY\n if (xMargin < yMargin) { node.children.sort(compareMinX); }\n};\n\n// total margin of all possible split distributions where each node is at least m full\nRBush.prototype._allDistMargin = function _allDistMargin (node, m, M, compare) {\n node.children.sort(compare);\n\n var toBBox = this.toBBox;\n var leftBBox = distBBox(node, 0, m, toBBox);\n var rightBBox = distBBox(node, M - m, M, toBBox);\n var margin = bboxMargin(leftBBox) + bboxMargin(rightBBox);\n\n for (var i = m; i < M - m; i++) {\n var child = node.children[i];\n extend(leftBBox, node.leaf ? toBBox(child) : child);\n margin += bboxMargin(leftBBox);\n }\n\n for (var i$1 = M - m - 1; i$1 >= m; i$1--) {\n var child$1 = node.children[i$1];\n extend(rightBBox, node.leaf ? toBBox(child$1) : child$1);\n margin += bboxMargin(rightBBox);\n }\n\n return margin;\n};\n\nRBush.prototype._adjustParentBBoxes = function _adjustParentBBoxes (bbox, path, level) {\n // adjust bboxes along the given tree path\n for (var i = level; i >= 0; i--) {\n extend(path[i], bbox);\n }\n};\n\nRBush.prototype._condense = function _condense (path) {\n // go through the path, removing empty nodes and updating bboxes\n for (var i = path.length - 1, siblings = (void 0); i >= 0; i--) {\n if (path[i].children.length === 0) {\n if (i > 0) {\n siblings = path[i - 1].children;\n siblings.splice(siblings.indexOf(path[i]), 1);\n\n } else { this.clear(); }\n\n } else { calcBBox(path[i], this.toBBox); }\n }\n};\n\nfunction findItem(item, items, equalsFn) {\n if (!equalsFn) { return items.indexOf(item); }\n\n for (var i = 0; i < items.length; i++) {\n if (equalsFn(item, items[i])) { return i; }\n }\n return -1;\n}\n\n// calculate node's bbox from bboxes of its children\nfunction calcBBox(node, toBBox) {\n distBBox(node, 0, node.children.length, toBBox, node);\n}\n\n// min bounding rectangle of node children from k to p-1\nfunction distBBox(node, k, p, toBBox, destNode) {\n if (!destNode) { destNode = createNode(null); }\n destNode.minX = Infinity;\n destNode.minY = Infinity;\n destNode.maxX = -Infinity;\n destNode.maxY = -Infinity;\n\n for (var i = k; i < p; i++) {\n var child = node.children[i];\n extend(destNode, node.leaf ? toBBox(child) : child);\n }\n\n return destNode;\n}\n\nfunction extend(a, b) {\n a.minX = Math.min(a.minX, b.minX);\n a.minY = Math.min(a.minY, b.minY);\n a.maxX = Math.max(a.maxX, b.maxX);\n a.maxY = Math.max(a.maxY, b.maxY);\n return a;\n}\n\nfunction compareNodeMinX(a, b) { return a.minX - b.minX; }\nfunction compareNodeMinY(a, b) { return a.minY - b.minY; }\n\nfunction bboxArea(a) { return (a.maxX - a.minX) * (a.maxY - a.minY); }\nfunction bboxMargin(a) { return (a.maxX - a.minX) + (a.maxY - a.minY); }\n\nfunction enlargedArea(a, b) {\n return (Math.max(b.maxX, a.maxX) - Math.min(b.minX, a.minX)) *\n (Math.max(b.maxY, a.maxY) - Math.min(b.minY, a.minY));\n}\n\nfunction intersectionArea(a, b) {\n var minX = Math.max(a.minX, b.minX);\n var minY = Math.max(a.minY, b.minY);\n var maxX = Math.min(a.maxX, b.maxX);\n var maxY = Math.min(a.maxY, b.maxY);\n\n return Math.max(0, maxX - minX) *\n Math.max(0, maxY - minY);\n}\n\nfunction contains(a, b) {\n return a.minX <= b.minX &&\n a.minY <= b.minY &&\n b.maxX <= a.maxX &&\n b.maxY <= a.maxY;\n}\n\nfunction intersects(a, b) {\n return b.minX <= a.maxX &&\n b.minY <= a.maxY &&\n b.maxX >= a.minX &&\n b.maxY >= a.minY;\n}\n\nfunction createNode(children) {\n return {\n children: children,\n height: 1,\n leaf: true,\n minX: Infinity,\n minY: Infinity,\n maxX: -Infinity,\n maxY: -Infinity\n };\n}\n\n// sort an array so that items come in groups of n unsorted items, with groups sorted between each other;\n// combines selection algorithm with binary divide & conquer approach\n\nfunction multiSelect(arr, left, right, n, compare) {\n var stack = [left, right];\n\n while (stack.length) {\n right = stack.pop();\n left = stack.pop();\n\n if (right - left <= n) { continue; }\n\n var mid = left + Math.ceil((right - left) / n / 2) * n;\n quickselect(arr, mid, left, right, compare);\n\n stack.push(left, mid, mid, right);\n }\n}\n\nreturn RBush;\n\n}));\n}(rbush));\n\nvar RBush = rbush.exports;\n\nvar Shape;\n(function (Shape) {\n Shape[\"GROUP\"] = \"g\";\n Shape[\"CIRCLE\"] = \"circle\";\n Shape[\"ELLIPSE\"] = \"ellipse\";\n Shape[\"IMAGE\"] = \"image\";\n Shape[\"RECT\"] = \"rect\";\n Shape[\"LINE\"] = \"line\";\n Shape[\"POLYLINE\"] = \"polyline\";\n Shape[\"POLYGON\"] = \"polygon\";\n Shape[\"TEXT\"] = \"text\";\n Shape[\"PATH\"] = \"path\";\n Shape[\"HTML\"] = \"html\";\n Shape[\"MESH\"] = \"mesh\";\n})(Shape || (Shape = {}));\nvar ClipSpaceNearZ;\n(function (ClipSpaceNearZ) {\n ClipSpaceNearZ[ClipSpaceNearZ[\"ZERO\"] = 0] = \"ZERO\";\n ClipSpaceNearZ[ClipSpaceNearZ[\"NEGATIVE_ONE\"] = 1] = \"NEGATIVE_ONE\";\n})(ClipSpaceNearZ || (ClipSpaceNearZ = {}));\n\nvar AbstractRendererPlugin = /** @class */ (function () {\n function AbstractRendererPlugin() {\n this.plugins = [];\n }\n AbstractRendererPlugin.prototype.addRenderingPlugin = function (plugin) {\n this.plugins.push(plugin);\n this.context.renderingPlugins.push(plugin);\n };\n AbstractRendererPlugin.prototype.removeAllRenderingPlugins = function () {\n var _this = this;\n this.plugins.forEach(function (plugin) {\n var index = _this.context.renderingPlugins.indexOf(plugin);\n if (index >= 0) {\n _this.context.renderingPlugins.splice(index, 1);\n }\n });\n };\n return AbstractRendererPlugin;\n}());\nvar AbstractRenderer = /** @class */ (function () {\n function AbstractRenderer(config) {\n this.clipSpaceNearZ = ClipSpaceNearZ.NEGATIVE_ONE;\n this.plugins = [];\n this.config = __assign({ \n /**\n * only dirty object will cause re-render\n */\n enableDirtyCheck: true, enableCulling: false, \n /**\n * enable auto rendering by default\n */\n enableAutoRendering: true, \n /**\n * enable dirty rectangle rendering by default\n */\n enableDirtyRectangleRendering: true, enableDirtyRectangleRenderingDebug: false }, config);\n }\n AbstractRenderer.prototype.registerPlugin = function (plugin) {\n var index = this.plugins.findIndex(function (p) { return p === plugin; });\n if (index === -1) {\n this.plugins.push(plugin);\n }\n };\n AbstractRenderer.prototype.unregisterPlugin = function (plugin) {\n var index = this.plugins.findIndex(function (p) { return p === plugin; });\n if (index > -1) {\n this.plugins.splice(index, 1);\n }\n };\n AbstractRenderer.prototype.getPlugins = function () {\n return this.plugins;\n };\n AbstractRenderer.prototype.getPlugin = function (name) {\n return this.plugins.find(function (plugin) { return plugin.name === name; });\n };\n AbstractRenderer.prototype.getConfig = function () {\n return this.config;\n };\n AbstractRenderer.prototype.setConfig = function (config) {\n Object.assign(this.config, config);\n };\n return AbstractRenderer;\n}());\n\nfunction copyVec3(a, b) {\n a[0] = b[0];\n a[1] = b[1];\n a[2] = b[2];\n return a;\n}\nfunction subVec3(o, a, b) {\n o[0] = a[0] - b[0];\n o[1] = a[1] - b[1];\n o[2] = a[2] - b[2];\n return o;\n}\nfunction addVec3(o, a, b) {\n o[0] = a[0] + b[0];\n o[1] = a[1] + b[1];\n o[2] = a[2] + b[2];\n return o;\n}\nfunction scaleVec3(o, a, b) {\n o[0] = a[0] * b;\n o[1] = a[1] * b;\n o[2] = a[2] * b;\n return o;\n}\nfunction maxVec3(o, a, b) {\n o[0] = Math.max(a[0], b[0]);\n o[1] = Math.max(a[1], b[1]);\n o[2] = Math.max(a[2], b[2]);\n return o;\n}\nfunction minVec3(o, a, b) {\n o[0] = Math.min(a[0], b[0]);\n o[1] = Math.min(a[1], b[1]);\n o[2] = Math.min(a[2], b[2]);\n return o;\n}\nfunction getAngle(angle) {\n if (angle === undefined) {\n return 0;\n }\n else if (angle > 360 || angle < -360) {\n return angle % 360;\n }\n return angle;\n}\nfunction createVec3(x, y, z) {\n if (y === void 0) { y = 0; }\n if (z === void 0) { z = 0; }\n if (Array.isArray(x) && x.length === 3) {\n return vec3.clone(x);\n }\n if (isNumber(x)) {\n return vec3.fromValues(x, y, z);\n }\n return vec3.fromValues(x[0], x[1] || y, x[2] || z);\n}\nfunction deg2rad(deg) {\n return deg * (Math.PI / 180);\n}\nfunction rad2deg(rad) {\n return rad * (180 / Math.PI);\n}\nfunction grad2deg(grads) {\n grads = grads % 400;\n if (grads < 0) {\n grads += 400;\n }\n return (grads / 400) * 360;\n}\nfunction deg2turn(deg) {\n return deg / 360;\n}\nfunction turn2deg(turn) {\n return 360 * turn;\n}\nfunction getEulerFromQuat(out, quat) {\n var x = quat[0];\n var y = quat[1];\n var z = quat[2];\n var w = quat[3];\n var x2 = x * x;\n var y2 = y * y;\n var z2 = z * z;\n var w2 = w * w;\n var unit = x2 + y2 + z2 + w2;\n var test = x * w - y * z;\n if (test > 0.499995 * unit) {\n // TODO: Use glmatrix.EPSILON\n // singularity at the north pole\n out[0] = Math.PI / 2;\n out[1] = 2 * Math.atan2(y, x);\n out[2] = 0;\n }\n else if (test < -0.499995 * unit) {\n //TODO: Use glmatrix.EPSILON\n // singularity at the south pole\n out[0] = -Math.PI / 2;\n out[1] = 2 * Math.atan2(y, x);\n out[2] = 0;\n }\n else {\n out[0] = Math.asin(2 * (x * z - w * y));\n out[1] = Math.atan2(2 * (x * w + y * z), 1 - 2 * (z2 + w2));\n out[2] = Math.atan2(2 * (x * y + z * w), 1 - 2 * (y2 + z2));\n }\n // TODO: Return them as degrees and not as radians\n return out;\n}\nfunction getEulerFromMat4(out, m) {\n var x;\n var z;\n var halfPi = Math.PI * 0.5;\n var _a = __read(mat4.getScaling(vec3.create(), m), 3), sx = _a[0], sy = _a[1], sz = _a[2];\n var y = Math.asin(-m[2] / sx);\n if (y < halfPi) {\n if (y > -halfPi) {\n x = Math.atan2(m[6] / sy, m[10] / sz);\n z = Math.atan2(m[1] / sx, m[0] / sx);\n }\n else {\n // Not a unique solution\n z = 0;\n x = -Math.atan2(m[4] / sy, m[5] / sy);\n }\n }\n else {\n // Not a unique solution\n z = 0;\n x = Math.atan2(m[4] / sy, m[5] / sy);\n }\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\n * @see https://github.com/toji/gl-matrix/issues/329\n * @see https://doc.babylonjs.com/divingDeeper/mesh/transforms/center_origin/rotation_conventions\n */\nfunction getEuler(out, quat) {\n if (quat.length === 16) {\n return getEulerFromMat4(out, quat);\n }\n else {\n return getEulerFromQuat(out, quat);\n }\n}\nfunction fromRotationTranslationScale(rotation, x, y, scaleX, scaleY) {\n var cos = Math.cos(rotation);\n var sin = Math.sin(rotation);\n return mat3.fromValues(scaleX * cos, scaleY * sin, 0, -scaleX * sin, scaleY * cos, 0, x, y, 1);\n}\nfunction makePerspective(out, left, right, top, bottom, near, far, zero) {\n if (zero === void 0) { zero = false; }\n var x = (2 * near) / (right - left);\n var y = (2 * near) / (top - bottom);\n var a = (right + left) / (right - left);\n var b = (top + bottom) / (top - bottom);\n var c;\n var d;\n if (zero) {\n c = -far / (far - near);\n d = (-far * near) / (far - near);\n }\n else {\n c = -(far + near) / (far - near);\n d = (-2 * far * near) / (far - near);\n }\n out[0] = x;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = y;\n out[6] = 0;\n out[7] = 0;\n out[8] = a;\n out[9] = b;\n out[10] = c;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = d;\n out[15] = 0;\n return out;\n}\nfunction decompose(mat) {\n var row0x = mat[0];\n var row0y = mat[1];\n var row1x = mat[3];\n var row1y = mat[4];\n // decompose 3x3 matrix\n // @see https://www.w3.org/TR/css-transforms-1/#decomposing-a-2d-matrix\n var scalingX = Math.sqrt(row0x * row0x + row0y * row0y);\n var scalingY = Math.sqrt(row1x * row1x + row1y * row1y);\n // If determinant is negative, one axis was flipped.\n var determinant = row0x * row1y - row0y * row1x;\n if (determinant < 0) {\n // Flip axis with minimum unit vector dot product.\n if (row0x < row1y) {\n scalingX = -scalingX;\n }\n else {\n scalingY = -scalingY;\n }\n }\n // Renormalize matrix to remove scale.\n if (scalingX) {\n row0x *= 1 / scalingX;\n row0y *= 1 / scalingX;\n }\n if (scalingY) {\n row1x *= 1 / scalingY;\n row1y *= 1 / scalingY;\n }\n // Compute rotation and renormalize matrix.\n var rotation = Math.atan2(row0y, row0x);\n var angle = rad2deg(rotation);\n return [mat[6], mat[7], scalingX, scalingY, angle];\n}\nvar tmp = mat4.create();\nvar perspectiveMatrix = mat4.create();\nvar tmpVec4 = vec4.create();\nvar row = [vec3.create(), vec3.create(), vec3.create()];\nvar pdum3 = vec3.create();\n/*\nInput: matrix ; a 4x4 matrix\nOutput: translation ; a 3 component vector\n scale ; a 3 component vector\n skew ; skew factors XY,XZ,YZ represented as a 3 component vector\n perspective ; a 4 component vector\n quaternion ; a 4 component vector\nReturns false if the matrix cannot be decomposed, true if it can\n\n\nReferences:\nhttps://github.com/kamicane/matrix3d/blob/master/lib/Matrix3d.js\nhttps://github.com/ChromiumWebApps/chromium/blob/master/ui/gfx/transform_util.cc\nhttp://www.w3.org/TR/css3-transforms/#decomposing-a-3d-matrix\n*/\nfunction decomposeMat4(matrix, translation, scale, skew, perspective, quaternion) {\n //normalize, if not possible then bail out early\n if (!normalize(tmp, matrix))\n return false;\n // perspectiveMatrix is used to solve for perspective, but it also provides\n // an easy way to test for singularity of the upper 3x3 component.\n mat4.copy(perspectiveMatrix, tmp);\n perspectiveMatrix[3] = 0;\n perspectiveMatrix[7] = 0;\n perspectiveMatrix[11] = 0;\n perspectiveMatrix[15] = 1;\n // If the perspectiveMatrix is not invertible, we are also unable to\n // decompose, so we'll bail early. Constant taken from SkMatrix44::invert.\n if (Math.abs(mat4.determinant(perspectiveMatrix)) < 1e-8)\n return false;\n var a03 = tmp[3], a13 = tmp[7], a23 = tmp[11], a30 = tmp[12], a31 = tmp[13], a32 = tmp[14], a33 = tmp[15];\n // First, isolate perspective.\n if (a03 !== 0 || a13 !== 0 || a23 !== 0) {\n tmpVec4[0] = a03;\n tmpVec4[1] = a13;\n tmpVec4[2] = a23;\n tmpVec4[3] = a33;\n // Solve the equation by inverting perspectiveMatrix and multiplying\n // rightHandSide by the inverse.\n // resuing the perspectiveMatrix here since it's no longer needed\n var ret = mat4.invert(perspectiveMatrix, perspectiveMatrix);\n if (!ret)\n return false;\n mat4.transpose(perspectiveMatrix, perspectiveMatrix);\n //multiply by transposed inverse perspective matrix, into perspective vec4\n vec4.transformMat4(perspective, tmpVec4, perspectiveMatrix);\n }\n else {\n //no perspective\n perspective[0] = perspective[1] = perspective[2] = 0;\n perspective[3] = 1;\n }\n // Next take care of translation\n translation[0] = a30;\n translation[1] = a31;\n translation[2] = a32;\n // Now get scale and shear. 'row' is a 3 element array of 3 component vectors\n mat3from4(row, tmp);\n // Compute X scale factor and normalize first row.\n scale[0] = vec3.length(row[0]);\n vec3.normalize(row[0], row[0]);\n // Compute XY shear factor and make 2nd row orthogonal to 1st.\n skew[0] = vec3.dot(row[0], row[1]);\n combine(row[1], row[1], row[0], 1.0, -skew[0]);\n // Now, compute Y scale and normalize 2nd row.\n scale[1] = vec3.length(row[1]);\n vec3.normalize(row[1], row[1]);\n skew[0] /= scale[1];\n // Compute XZ and YZ shears, orthogonalize 3rd row\n skew[1] = vec3.dot(row[0], row[2]);\n combine(row[2], row[2], row[0], 1.0, -skew[1]);\n skew[2] = vec3.dot(row[1], row[2]);\n combine(row[2], row[2], row[1], 1.0, -skew[2]);\n // Next, get Z scale and normalize 3rd row.\n scale[2] = vec3.length(row[2]);\n vec3.normalize(row[2], row[2]);\n skew[1] /= scale[2];\n skew[2] /= scale[2];\n // At this point, the matrix (in rows) is orthonormal.\n // Check for a coordinate system flip. If the determinant\n // is -1, then negate the matrix and the scaling factors.\n vec3.cross(pdum3, row[1], row[2]);\n if (vec3.dot(row[0], pdum3) < 0) {\n for (var i = 0; i < 3; i++) {\n scale[i] *= -1;\n row[i][0] *= -1;\n row[i][1] *= -1;\n row[i][2] *= -1;\n }\n }\n // Now, get the rotations out\n quaternion[0] =\n 0.5 * Math.sqrt(Math.max(1 + row[0][0] - row[1][1] - row[2][2], 0));\n quaternion[1] =\n 0.5 * Math.sqrt(Math.max(1 - row[0][0] + row[1][1] - row[2][2], 0));\n quaternion[2] =\n 0.5 * Math.sqrt(Math.max(1 - row[0][0] - row[1][1] + row[2][2], 0));\n quaternion[3] =\n 0.5 * Math.sqrt(Math.max(1 + row[0][0] + row[1][1] + row[2][2], 0));\n if (row[2][1] > row[1][2])\n quaternion[0] = -quaternion[0];\n if (row[0][2] > row[2][0])\n quaternion[1] = -quaternion[1];\n if (row[1][0] > row[0][1])\n quaternion[2] = -quaternion[2];\n return true;\n}\nfunction normalize(out, mat) {\n var m44 = mat[15];\n // Cannot normalize.\n if (m44 === 0)\n return false;\n var scale = 1 / m44;\n for (var i = 0; i < 16; i++)\n out[i] = mat[i] * scale;\n return true;\n}\n//gets upper-left of a 4x4 matrix into a 3x3 of vectors\nfunction mat3from4(out, mat4x4) {\n out[0][0] = mat4x4[0];\n out[0][1] = mat4x4[1];\n out[0][2] = mat4x4[2];\n out[1][0] = mat4x4[4];\n out[1][1] = mat4x4[5];\n out[1][2] = mat4x4[6];\n out[2][0] = mat4x4[8];\n out[2][1] = mat4x4[9];\n out[2][2] = mat4x4[10];\n}\nfunction combine(out, a, b, scale1, scale2) {\n out[0] = a[0] * scale1 + b[0] * scale2;\n out[1] = a[1] * scale1 + b[1] * scale2;\n out[2] = a[2] * scale1 + b[2] * scale2;\n}\n\n/**\n * Axis-Aligned Bounding Box\n * 为了便于后续 Frustum Culling,通过查找表定义 p-vertex 和 n-vertex\n * @see https://github.com/antvis/GWebGPUEngine/issues/3\n */\nvar AABB = /** @class */ (function () {\n function AABB() {\n this.center = [0, 0, 0];\n this.halfExtents = [0, 0, 0];\n this.min = [0, 0, 0];\n this.max = [0, 0, 0];\n }\n AABB.isEmpty = function (aabb) {\n return (!aabb ||\n (aabb.halfExtents[0] === 0 &&\n aabb.halfExtents[1] === 0 &&\n aabb.halfExtents[2] === 0));\n };\n // center: vec3 = vec3.create();\n // halfExtents: vec3 = vec3.create();\n // min: vec3 = vec3.create();\n // max: vec3 = vec3.create();\n AABB.prototype.update = function (center, halfExtents) {\n copyVec3(this.center, center);\n copyVec3(this.halfExtents, halfExtents);\n subVec3(this.min, this.center, this.halfExtents);\n addVec3(this.max, this.center, this.halfExtents);\n // vec3.copy(this.center, center);\n // vec3.copy(this.halfExtents, halfExtents);\n // vec3.sub(this.min, this.center, this.halfExtents);\n // vec3.add(this.max, this.center, this.halfExtents);\n };\n AABB.prototype.setMinMax = function (min, max) {\n // vec3.add(this.center, max, min);\n // vec3.scale(this.center, this.center, 0.5);\n // vec3.sub(this.halfExtents, max, min);\n // vec3.scale(this.halfExtents, this.halfExtents, 0.5);\n // vec3.copy(this.min, min);\n // vec3.copy(this.max, max);\n addVec3(this.center, max, min);\n scaleVec3(this.center, this.center, 0.5);\n subVec3(this.halfExtents, max, min);\n scaleVec3(this.halfExtents, this.halfExtents, 0.5);\n copyVec3(this.min, min);\n copyVec3(this.max, max);\n };\n AABB.prototype.getMin = function () {\n return this.min;\n };\n AABB.prototype.getMax = function () {\n return this.max;\n };\n AABB.prototype.add = function (aabb) {\n if (AABB.isEmpty(aabb)) {\n return;\n }\n if (AABB.isEmpty(this)) {\n this.setMinMax(aabb.getMin(), aabb.getMax());\n return;\n }\n var tc = this.center;\n var tcx = tc[0];\n var tcy = tc[1];\n var tcz = tc[2];\n var th = this.halfExtents;\n var thx = th[0];\n var thy = th[1];\n var thz = th[2];\n var tminx = tcx - thx;\n var tmaxx = tcx + thx;\n var tminy = tcy - thy;\n var tmaxy = tcy + thy;\n var tminz = tcz - thz;\n var tmaxz = tcz + thz;\n var oc = aabb.center;\n var ocx = oc[0];\n var ocy = oc[1];\n var ocz = oc[2];\n var oh = aabb.halfExtents;\n var ohx = oh[0];\n var ohy = oh[1];\n var ohz = oh[2];\n var ominx = ocx - ohx;\n var omaxx = ocx + ohx;\n var ominy = ocy - ohy;\n var omaxy = ocy + ohy;\n var ominz = ocz - ohz;\n var omaxz = ocz + ohz;\n if (ominx < tminx) {\n tminx = ominx;\n }\n if (omaxx > tmaxx) {\n tmaxx = omaxx;\n }\n if (ominy < tminy) {\n tminy = ominy;\n }\n if (omaxy > tmaxy) {\n tmaxy = omaxy;\n }\n if (ominz < tminz) {\n tminz = ominz;\n }\n if (omaxz > tmaxz) {\n tmaxz = omaxz;\n }\n tc[0] = (tminx + tmaxx) * 0.5;\n tc[1] = (tminy + tmaxy) * 0.5;\n tc[2] = (tminz + tmaxz) * 0.5;\n th[0] = (tmaxx - tminx) * 0.5;\n th[1] = (tmaxy - tminy) * 0.5;\n th[2] = (tmaxz - tminz) * 0.5;\n this.min[0] = tminx;\n this.min[1] = tminy;\n this.min[2] = tminz;\n this.max[0] = tmaxx;\n this.max[1] = tmaxy;\n this.max[2] = tmaxz;\n };\n AABB.prototype.setFromTransformedAABB = function (aabb, m) {\n var bc = this.center;\n var br = this.halfExtents;\n var ac = aabb.center;\n var ar = aabb.halfExtents;\n var mx0 = m[0];\n var mx1 = m[4];\n var mx2 = m[8];\n var my0 = m[1];\n var my1 = m[5];\n var my2 = m[9];\n var mz0 = m[2];\n var mz1 = m[6];\n var mz2 = m[10];\n var mx0a = Math.abs(mx0);\n var mx1a = Math.abs(mx1);\n var mx2a = Math.abs(mx2);\n var my0a = Math.abs(my0);\n var my1a = Math.abs(my1);\n var my2a = Math.abs(my2);\n var mz0a = Math.abs(mz0);\n var mz1a = Math.abs(mz1);\n var mz2a = Math.abs(mz2);\n bc[0] = m[12] + mx0 * ac[0] + mx1 * ac[1] + mx2 * ac[2];\n bc[1] = m[13] + my0 * ac[0] + my1 * ac[1] + my2 * ac[2];\n bc[2] = m[14] + mz0 * ac[0] + mz1 * ac[1] + mz2 * ac[2];\n // vec3.set(\n // bc,\n // m[12] + mx0 * ac[0] + mx1 * ac[1] + mx2 * ac[2],\n // m[13] + my0 * ac[0] + my1 * ac[1] + my2 * ac[2],\n // m[14] + mz0 * ac[0] + mz1 * ac[1] + mz2 * ac[2],\n // );\n br[0] = mx0a * ar[0] + mx1a * ar[1] + mx2a * ar[2];\n br[1] = my0a * ar[0] + my1a * ar[1] + my2a * ar[2];\n br[2] = mz0a * ar[0] + mz1a * ar[1] + mz2a * ar[2];\n // vec3.set(\n // br,\n // mx0a * ar[0] + mx1a * ar[1] + mx2a * ar[2],\n // my0a * ar[0] + my1a * ar[1] + my2a * ar[2],\n // mz0a * ar[0] + mz1a * ar[1] + mz2a * ar[2],\n // );\n // this.min = vec3.sub(this.min, bc, br);\n // this.max = vec3.add(this.max, bc, br);\n subVec3(this.min, bc, br);\n addVec3(this.max, bc, br);\n };\n AABB.prototype.intersects = function (aabb) {\n var aMax = this.getMax();\n var aMin = this.getMin();\n var bMax = aabb.getMax();\n var bMin = aabb.getMin();\n return (aMin[0] <= bMax[0] &&\n aMax[0] >= bMin[0] &&\n aMin[1] <= bMax[1] &&\n aMax[1] >= bMin[1] &&\n aMin[2] <= bMax[2] &&\n aMax[2] >= bMin[2]);\n };\n AABB.prototype.intersection = function (aabb) {\n if (!this.intersects(aabb)) {\n return null;\n }\n var intersection = new AABB();\n // const min = vec3.max(vec3.create(), this.getMin(), aabb.getMin());\n // const max = vec3.min(vec3.create(), this.getMax(), aabb.getMax());\n var min = maxVec3([0, 0, 0], this.getMin(), aabb.getMin());\n var max = minVec3([0, 0, 0], this.getMax(), aabb.getMax());\n intersection.setMinMax(min, max);\n return intersection;\n };\n // containsPoint(point: vec3) {\n // const min = this.getMin();\n // const max = this.getMax();\n // return !(\n // point[0] < min[0] ||\n // point[0] > max[0] ||\n // point[1] < min[1] ||\n // point[1] > max[1] ||\n // point[2] < min[2] ||\n // point[2] > max[2]\n // );\n // }\n /**\n * get n-vertex\n * @param plane plane of CullingVolume\n */\n AABB.prototype.getNegativeFarPoint = function (plane) {\n if (plane.pnVertexFlag === 0x111) {\n return copyVec3([0, 0, 0], this.min);\n // return vec3.copy(vec3.create(), this.min);\n }\n else if (plane.pnVertexFlag === 0x110) {\n return [this.min[0], this.min[1], this.max[2]];\n // return vec3.fromValues(this.min[0], this.min[1], this.max[2]);\n }\n else if (plane.pnVertexFlag === 0x101) {\n return [this.min[0], this.max[1], this.min[2]];\n // return vec3.fromValues(this.min[0], this.max[1], this.min[2]);\n }\n else if (plane.pnVertexFlag === 0x100) {\n return [this.min[0], this.max[1], this.max[2]];\n // return vec3.fromValues(this.min[0], this.max[1], this.max[2]);\n }\n else if (plane.pnVertexFlag === 0x011) {\n return [this.max[0], this.min[1], this.min[2]];\n // return vec3.fromValues(this.max[0], this.min[1], this.min[2]);\n }\n else if (plane.pnVertexFlag === 0x010) {\n return [this.max[0], this.min[1], this.max[2]];\n // return vec3.fromValues(this.max[0], this.min[1], this.max[2]);\n }\n else if (plane.pnVertexFlag === 0x001) {\n return [this.max[0], this.max[1], this.min[2]];\n // return vec3.fromValues(this.max[0], this.max[1], this.min[2]);\n }\n else {\n return [this.max[0], this.max[1], this.max[2]];\n // return vec3.fromValues(this.max[0], this.max[1], this.max[2]);\n }\n };\n /**\n * get p-vertex\n * @param plane plane of CullingVolume\n */\n AABB.prototype.getPositiveFarPoint = function (plane) {\n if (plane.pnVertexFlag === 0x111) {\n return copyVec3([0, 0, 0], this.max);\n // return vec3.copy(vec3.create(), this.max);\n }\n else if (plane.pnVertexFlag === 0x110) {\n return [this.max[0], this.max[1], this.min[2]];\n // return vec3.fromValues(this.max[0], this.max[1], this.min[2]);\n }\n else if (plane.pnVertexFlag === 0x101) {\n return [this.max[0], this.min[1], this.max[2]];\n // return vec3.fromValues(this.max[0], this.min[1], this.max[2]);\n }\n else if (plane.pnVertexFlag === 0x100) {\n return [this.max[0], this.min[1], this.min[2]];\n // return vec3.fromValues(this.max[0], this.min[1], this.min[2]);\n }\n else if (plane.pnVertexFlag === 0x011) {\n return [this.min[0], this.max[1], this.max[2]];\n // return vec3.fromValues(this.min[0], this.max[1], this.max[2]);\n }\n else if (plane.pnVertexFlag === 0x010) {\n return [this.min[0], this.max[1], this.min[2]];\n // return vec3.fromValues(this.min[0], this.max[1], this.min[2]);\n }\n else if (plane.pnVertexFlag === 0x001) {\n return [this.min[0], this.min[1], this.max[2]];\n // return vec3.fromValues(this.min[0], this.min[1], this.max[2]);\n }\n else {\n return [this.min[0], this.min[1], this.min[2]];\n // return vec3.fromValues(this.min[0], this.min[1], this.min[2]);\n }\n };\n return AABB;\n}());\n\nvar Plane = /** @class */ (function () {\n function Plane(distance, normal) {\n this.distance = distance || 0;\n this.normal = normal || vec3.fromValues(0, 1, 0);\n this.updatePNVertexFlag();\n }\n Plane.prototype.updatePNVertexFlag = function () {\n this.pnVertexFlag =\n (Number(this.normal[0] >= 0) << 8) +\n (Number(this.normal[1] >= 0) << 4) +\n Number(this.normal[2] >= 0);\n };\n Plane.prototype.distanceToPoint = function (point) {\n return vec3.dot(point, this.normal) - this.distance;\n };\n Plane.prototype.normalize = function () {\n var invLen = 1 / vec3.len(this.normal);\n vec3.scale(this.normal, this.normal, invLen);\n this.distance *= invLen;\n };\n Plane.prototype.intersectsLine = function (start, end, point) {\n var d0 = this.distanceToPoint(start);\n var d1 = this.distanceToPoint(end);\n var t = d0 / (d0 - d1);\n var intersects = t >= 0 && t <= 1;\n if (intersects && point) {\n vec3.lerp(point, start, end, t);\n }\n return intersects;\n };\n return Plane;\n}());\n\nvar Mask;\n(function (Mask) {\n Mask[Mask[\"OUTSIDE\"] = 4294967295] = \"OUTSIDE\";\n Mask[Mask[\"INSIDE\"] = 0] = \"INSIDE\";\n Mask[Mask[\"INDETERMINATE\"] = 2147483647] = \"INDETERMINATE\";\n})(Mask || (Mask = {}));\nvar Frustum = /** @class */ (function () {\n function Frustum(planes) {\n this.planes = [];\n if (planes) {\n this.planes = planes;\n }\n else {\n for (var i = 0; i < 6; i++) {\n this.planes.push(new Plane());\n }\n }\n }\n /**\n * extract 6 planes from projectionMatrix\n * @see http://www8.cs.umu.se/kurser/5DV051/HT12/lab/plane_extraction.pdf\n */\n Frustum.prototype.extractFromVPMatrix = function (projectionMatrix) {\n // @ts-ignore\n var _a = __read(projectionMatrix, 16), m0 = _a[0], m1 = _a[1], m2 = _a[2], m3 = _a[3], m4 = _a[4], m5 = _a[5], m6 = _a[6], m7 = _a[7], m8 = _a[8], m9 = _a[9], m10 = _a[10], m11 = _a[11], m12 = _a[12], m13 = _a[13], m14 = _a[14], m15 = _a[15];\n // right\n vec3.set(this.planes[0].normal, m3 - m0, m7 - m4, m11 - m8);\n this.planes[0].distance = m15 - m12;\n // left\n vec3.set(this.planes[1].normal, m3 + m0, m7 + m4, m11 + m8);\n this.planes[1].distance = m15 + m12;\n // bottom\n vec3.set(this.planes[2].normal, m3 + m1, m7 + m5, m11 + m9);\n this.planes[2].distance = m15 + m13;\n // top\n vec3.set(this.planes[3].normal, m3 - m1, m7 - m5, m11 - m9);\n this.planes[3].distance = m15 - m13;\n // far\n vec3.set(this.planes[4].normal, m3 - m2, m7 - m6, m11 - m10);\n this.planes[4].distance = m15 - m14;\n // near\n vec3.set(this.planes[5].normal, m3 + m2, m7 + m6, m11 + m10);\n this.planes[5].distance = m15 + m14;\n this.planes.forEach(function (plane) {\n plane.normalize();\n plane.updatePNVertexFlag();\n });\n };\n return Frustum;\n}());\n\nvar Point = /** @class */ (function () {\n function Point(x, y) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n this.x = 0;\n this.y = 0;\n this.x = x;\n this.y = y;\n }\n Point.prototype.clone = function () {\n return new Point(this.x, this.y);\n };\n Point.prototype.copyFrom = function (p) {\n this.x = p.x;\n this.y = p.y;\n };\n return Point;\n}());\n\nvar Rectangle = /** @class */ (function () {\n function Rectangle(x, y, width, height) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.left = x;\n this.right = x + width;\n this.top = y;\n this.bottom = y + height;\n }\n Rectangle.prototype.toJSON = function () { };\n return Rectangle;\n}());\n\nvar ERROR_MSG_METHOD_NOT_IMPLEMENTED = 'Method not implemented.';\nvar ERROR_MSG_USE_DOCUMENT_ELEMENT = 'Use document.documentElement instead.';\nvar ERROR_MSG_APPEND_DESTROYED_ELEMENT = 'Cannot append a destroyed element.';\n\n/**\n * Different type of cameras, eg. simple camera used in 2D scene or\n * advanced camera which can do actions & switch between landmarks.\n */\nvar CameraType;\n(function (CameraType) {\n /**\n * Performs all the rotational operations with the focal point instead of the camera position.\n * This type of camera is useful in applications(like CAD) where 3D objects are being designed or explored.\n * Camera cannot orbits over the north & south poles.\n * @see http://voxelent.com/tutorial-cameras/\n *\n * In Three.js it's used in OrbitControls.\n * @see https://threejs.org/docs/#examples/zh/controls/OrbitControls\n */\n CameraType[CameraType[\"ORBITING\"] = 0] = \"ORBITING\";\n /**\n * It's similar to the ORBITING camera, but it allows the camera to orbit over the north or south poles.\n *\n * In Three.js it's used in OrbitControls.\n * @see https://threejs.org/docs/#examples/en/controls/TrackballControls\n */\n CameraType[CameraType[\"EXPLORING\"] = 1] = \"EXPLORING\";\n /**\n * Performs all the rotational operations with the camera position.\n * It's useful in first person shooting games.\n * Camera cannot orbits over the north & south poles.\n *\n * In Three.js it's used in FirstPersonControls.\n * @see https://threejs.org/docs/#examples/en/controls/FirstPersonControls\n */\n CameraType[CameraType[\"TRACKING\"] = 2] = \"TRACKING\";\n})(CameraType || (CameraType = {}));\n/**\n * CameraType must be TRACKING\n */\nvar CameraTrackingMode;\n(function (CameraTrackingMode) {\n CameraTrackingMode[CameraTrackingMode[\"DEFAULT\"] = 0] = \"DEFAULT\";\n CameraTrackingMode[CameraTrackingMode[\"ROTATIONAL\"] = 1] = \"ROTATIONAL\";\n CameraTrackingMode[CameraTrackingMode[\"TRANSLATIONAL\"] = 2] = \"TRANSLATIONAL\";\n CameraTrackingMode[CameraTrackingMode[\"CINEMATIC\"] = 3] = \"CINEMATIC\";\n})(CameraTrackingMode || (CameraTrackingMode = {}));\nvar CameraProjectionMode;\n(function (CameraProjectionMode) {\n CameraProjectionMode[CameraProjectionMode[\"ORTHOGRAPHIC\"] = 0] = \"ORTHOGRAPHIC\";\n CameraProjectionMode[CameraProjectionMode[\"PERSPECTIVE\"] = 1] = \"PERSPECTIVE\";\n})(CameraProjectionMode || (CameraProjectionMode = {}));\nvar CameraEvent = {\n UPDATED: 'updated',\n};\n\nvar MIN_DISTANCE = 0.0002;\n/**\n * 参考「WebGL Insights - 23.Designing Cameras for WebGL Applications」,基于 Responsible Camera 思路设计\n * @see https://github.com/d13g0/nucleo.js/blob/master/source/camera/Camera.js\n *\n * 保存相机参数,定义相机动作:\n * 1. dolly 沿 n 轴移动\n * 2. pan 沿 u v 轴移动\n * 3. rotate 以方位角旋转\n * 4. 移动到 Landmark,具有平滑的动画效果,其间禁止其他用户交互\n */\nvar Camera = /** @class */ (function () {\n function Camera() {\n /**\n * Clip space near Z, default to range `[-1, 1]`\n */\n this.clipSpaceNearZ = ClipSpaceNearZ.NEGATIVE_ONE;\n this.eventEmitter = new EventEmitter();\n /**\n * Matrix of camera\n */\n this.matrix = mat4.create();\n /**\n * u axis +X is right\n * @see http://learnwebgl.brown37.net/07_cameras/camera_introduction.html#a-camera-definition\n */\n this.right = vec3.fromValues(1, 0, 0);\n /**\n * v axis +Y is up\n */\n this.up = vec3.fromValues(0, 1, 0);\n /**\n * n axis +Z is inside\n */\n this.forward = vec3.fromValues(0, 0, 1);\n /**\n * Position of camera.\n */\n this.position = vec3.fromValues(0, 0, 1);\n /**\n * Position of focal point.\n */\n this.focalPoint = vec3.fromValues(0, 0, 0);\n /**\n * vector from focalPoint to position\n */\n this.distanceVector = vec3.fromValues(0, 0, -1);\n /**\n * length(focalPoint - position)\n */\n this.distance = 1;\n /**\n * @see https://en.wikipedia.org/wiki/Azimuth\n */\n this.azimuth = 0;\n this.elevation = 0;\n this.roll = 0;\n this.relAzimuth = 0;\n this.relElevation = 0;\n this.relRoll = 0;\n /**\n * 沿 n 轴移动时,保证移动速度从快到慢\n */\n this.dollyingStep = 0;\n this.maxDistance = Infinity;\n this.minDistance = -Infinity;\n /**\n * zoom factor of the camera, default is 1\n * eg. https://threejs.org/docs/#api/en/cameras/OrthographicCamera.zoom\n */\n this.zoom = 1;\n /**\n * invert the horizontal coordinate system HCS\n */\n this.rotateWorld = false;\n /**\n * 投影矩阵参数\n */\n /**\n * field of view [0-360]\n * @see http://en.wikipedia.org/wiki/Angle_of_view\n */\n this.fov = 30;\n this.near = 0.1;\n this.far = 1000;\n this.aspect = 1;\n this.projectionMatrix = mat4.create();\n this.projectionMatrixInverse = mat4.create();\n this.jitteredProjectionMatrix = undefined;\n this.enableUpdate = true;\n // protected following = undefined;\n this.type = CameraType.EXPLORING;\n this.trackingMode = CameraTrackingMode.DEFAULT;\n this.projectionMode = CameraProjectionMode.PERSPECTIVE;\n /**\n * for culling use\n */\n this.frustum = new Frustum();\n /**\n * ortho matrix for Canvas2D & SVG\n */\n this.orthoMatrix = mat4.create();\n }\n // constructor(type = CameraType.EXPLORING, trackingMode = CameraTrackingMode.DEFAULT) {\n // this.setType(type, trackingMode);\n // }\n Camera.prototype.isOrtho = function () {\n return this.projectionMode === CameraProjectionMode.ORTHOGRAPHIC;\n };\n Camera.prototype.getProjectionMode = function () {\n return this.projectionMode;\n };\n Camera.prototype.getPerspective = function () {\n // account for TAA\n return this.jitteredProjectionMatrix || this.projectionMatrix;\n };\n Camera.prototype.getPerspectiveInverse = function () {\n return this.projectionMatrixInverse;\n };\n Camera.prototype.getFrustum = function () {\n return this.frustum;\n };\n Camera.prototype.getPosition = function () {\n return this.position;\n };\n Camera.prototype.getFocalPoint = function () {\n return this.focalPoint;\n };\n Camera.prototype.getDollyingStep = function () {\n return this.dollyingStep;\n };\n Camera.prototype.getNear = function () {\n return this.near;\n };\n Camera.prototype.getFar = function () {\n return this.far;\n };\n Camera.prototype.getZoom = function () {\n return this.zoom;\n };\n Camera.prototype.getOrthoMatrix = function () {\n return this.orthoMatrix;\n };\n Camera.prototype.getView = function () {\n return this.view;\n };\n Camera.prototype.setEnableUpdate = function (enabled) {\n this.enableUpdate = enabled;\n };\n Camera.prototype.setType = function (type, trackingMode) {\n this.type = type;\n if (this.type === CameraType.EXPLORING) {\n this.setWorldRotation(true);\n }\n else {\n this.setWorldRotation(false);\n }\n this._getAngles();\n if (this.type === CameraType.TRACKING && trackingMode !== undefined) {\n this.setTrackingMode(trackingMode);\n }\n return this;\n };\n Camera.prototype.setProjectionMode = function (projectionMode) {\n this.projectionMode = projectionMode;\n return this;\n };\n Camera.prototype.setTrackingMode = function (trackingMode) {\n if (this.type !== CameraType.TRACKING) {\n throw new Error('Impossible to set a tracking mode if the camera is not of tracking type');\n }\n this.trackingMode = trackingMode;\n return this;\n };\n /**\n * If flag is true, it reverses the azimuth and elevation angles.\n * Subsequent calls to rotate, setAzimuth, setElevation,\n * changeAzimuth or changeElevation will cause the inverted effect.\n * setRoll or changeRoll is not affected by this method.\n *\n * This inversion is useful when one wants to simulate that the world\n * is moving, instead of the camera.\n *\n * By default the camera angles are not reversed.\n * @param {Boolean} flag the boolean flag to reverse the angles.\n */\n Camera.prototype.setWorldRotation = function (flag) {\n this.rotateWorld = flag;\n this._getAngles();\n return this;\n };\n /**\n * 计算 MV 矩阵,为相机矩阵的逆矩阵\n */\n Camera.prototype.getViewTransform = function () {\n return mat4.invert(mat4.create(), this.matrix);\n };\n Camera.prototype.getWorldTransform = function () {\n return this.matrix;\n };\n Camera.prototype.jitterProjectionMatrix = function (x, y) {\n var translation = mat4.fromTranslation(mat4.create(), [x, y, 0]);\n this.jitteredProjectionMatrix = mat4.multiply(mat4.create(), translation, this.projectionMatrix);\n };\n Camera.prototype.clearJitterProjectionMatrix = function () {\n this.jitteredProjectionMatrix = undefined;\n };\n /**\n * 设置相机矩阵\n */\n Camera.prototype.setMatrix = function (matrix) {\n this.matrix = matrix;\n this._update();\n return this;\n };\n Camera.prototype.setFov = function (fov) {\n this.setPerspective(this.near, this.far, fov, this.aspect);\n return this;\n };\n Camera.prototype.setAspect = function (aspect) {\n this.setPerspective(this.near, this.far, this.fov, aspect);\n return this;\n };\n Camera.prototype.setNear = function (near) {\n if (this.projectionMode === CameraProjectionMode.PERSPECTIVE) {\n this.setPerspective(near, this.far, this.fov, this.aspect);\n }\n else {\n this.setOrthographic(this.left, this.rright, this.top, this.bottom, near, this.far);\n }\n return this;\n };\n Camera.prototype.setFar = function (far) {\n if (this.projectionMode === CameraProjectionMode.PERSPECTIVE) {\n this.setPerspective(this.near, far, this.fov, this.aspect);\n }\n else {\n this.setOrthographic(this.left, this.rright, this.top, this.bottom, this.near, far);\n }\n return this;\n };\n /**\n * Sets an offset in a larger frustum, used in PixelPicking\n */\n Camera.prototype.setViewOffset = function (fullWidth, fullHeight, x, y, width, height) {\n this.aspect = fullWidth / fullHeight;\n if (this.view === undefined) {\n this.view = {\n enabled: true,\n fullWidth: 1,\n fullHeight: 1,\n offsetX: 0,\n offsetY: 0,\n width: 1,\n height: 1,\n };\n }\n this.view.enabled = true;\n this.view.fullWidth = fullWidth;\n this.view.fullHeight = fullHeight;\n this.view.offsetX = x;\n this.view.offsetY = y;\n this.view.width = width;\n this.view.height = height;\n if (this.projectionMode === CameraProjectionMode.PERSPECTIVE) {\n this.setPerspective(this.near, this.far, this.fov, this.aspect);\n }\n else {\n this.setOrthographic(this.left, this.rright, this.top, this.bottom, this.near, this.far);\n }\n return this;\n };\n Camera.prototype.clearViewOffset = function () {\n if (this.view !== undefined) {\n this.view.enabled = false;\n }\n if (this.projectionMode === CameraProjectionMode.PERSPECTIVE) {\n this.setPerspective(this.near, this.far, this.fov, this.aspect);\n }\n else {\n this.setOrthographic(this.left, this.rright, this.top, this.bottom, this.near, this.far);\n }\n return this;\n };\n Camera.prototype.setZoom = function (zoom) {\n this.zoom = zoom;\n if (this.projectionMode === CameraProjectionMode.ORTHOGRAPHIC) {\n this.setOrthographic(this.left, this.rright, this.top, this.bottom, this.near, this.far);\n }\n else if (this.projectionMode === CameraProjectionMode.PERSPECTIVE) {\n this.setPerspective(this.near, this.far, this.fov, this.aspect);\n }\n return this;\n };\n /**\n * Zoom by specified point in viewport coordinates.\n */\n Camera.prototype.setZoomByViewportPoint = function (zoom, viewportPoint) {\n var _a = this.canvas.viewport2Canvas({\n x: viewportPoint[0],\n y: viewportPoint[1],\n }), ox = _a.x, oy = _a.y;\n var roll = this.roll;\n this.rotate(0, 0, -roll);\n this.setPosition(ox, oy);\n this.setFocalPoint(ox, oy);\n this.setZoom(zoom);\n this.rotate(0, 0, roll);\n var _b = this.canvas.viewport2Canvas({\n x: viewportPoint[0],\n y: viewportPoint[1],\n }), cx = _b.x, cy = _b.y;\n // project to rotated axis\n var dvec = vec3.fromValues(cx - ox, cy - oy, 0);\n var dx = vec3.dot(dvec, this.right) / vec3.length(this.right);\n var dy = vec3.dot(dvec, this.up) / vec3.length(this.up);\n this.pan(-dx, -dy);\n return this;\n };\n Camera.prototype.setPerspective = function (near, far, fov, aspect) {\n var _a;\n this.projectionMode = CameraProjectionMode.PERSPECTIVE;\n this.fov = fov;\n this.near = near;\n this.far = far;\n this.aspect = aspect;\n var top = (this.near * Math.tan(deg2rad(0.5 * this.fov))) / this.zoom;\n var height = 2 * top;\n var width = this.aspect * height;\n var left = -0.5 * width;\n if ((_a = this.view) === null || _a === void 0 ? void 0 : _a.enabled) {\n var fullWidth = this.view.fullWidth;\n var fullHeight = this.view.fullHeight;\n left += (this.view.offsetX * width) / fullWidth;\n top -= (this.view.offsetY * height) / fullHeight;\n width *= this.view.width / fullWidth;\n height *= this.view.height / fullHeight;\n }\n makePerspective(this.projectionMatrix, left, left + width, top, top - height, near, this.far, this.clipSpaceNearZ === ClipSpaceNearZ.ZERO);\n // flipY since the origin of OpenGL/WebGL is bottom-left compared with top-left in Canvas2D\n mat4.scale(this.projectionMatrix, this.projectionMatrix, vec3.fromValues(1, -1, 1));\n mat4.invert(this.projectionMatrixInverse, this.projectionMatrix);\n this.triggerUpdate();\n return this;\n };\n Camera.prototype.setOrthographic = function (l, r, t, b, near, far) {\n var _a;\n this.projectionMode = CameraProjectionMode.ORTHOGRAPHIC;\n this.rright = r;\n this.left = l;\n this.top = t;\n this.bottom = b;\n this.near = near;\n this.far = far;\n var dx = (this.rright - this.left) / (2 * this.zoom);\n var dy = (this.top - this.bottom) / (2 * this.zoom);\n var cx = (this.rright + this.left) / 2;\n var cy = (this.top + this.bottom) / 2;\n var left = cx - dx;\n var right = cx + dx;\n var top = cy + dy;\n var bottom = cy - dy;\n if ((_a = this.view) === null || _a === void 0 ? void 0 : _a.enabled) {\n var scaleW = (this.rright - this.left) / this.view.fullWidth / this.zoom;\n var scaleH = (this.top - this.bottom) / this.view.fullHeight / this.zoom;\n left += scaleW * this.view.offsetX;\n right = left + scaleW * this.view.width;\n top -= scaleH * this.view.offsetY;\n bottom = top - scaleH * this.view.height;\n }\n if (this.clipSpaceNearZ === ClipSpaceNearZ.NEGATIVE_ONE) {\n mat4.ortho(this.projectionMatrix, left, right, bottom, top, near, far);\n }\n else {\n mat4.orthoZO(this.projectionMatrix, left, right, bottom, top, near, far);\n }\n // flipY since the origin of OpenGL/WebGL is bottom-left compared with top-left in Canvas2D\n mat4.scale(this.projectionMatrix, this.projectionMatrix, vec3.fromValues(1, -1, 1));\n mat4.invert(this.projectionMatrixInverse, this.projectionMatrix);\n this._getOrthoMatrix();\n this.triggerUpdate();\n return this;\n };\n /**\n * Move the camera in world coordinates.\n * It will keep looking at the current focal point.\n *\n * support scalars or vectors.\n * @example\n * setPosition(1, 2, 3);\n * setPosition([1, 2, 3]);\n */\n Camera.prototype.setPosition = function (x, y, z) {\n if (y === void 0) { y = this.position[1]; }\n if (z === void 0) { z = this.position[2]; }\n var position = createVec3(x, y, z);\n this._setPosition(position);\n this.setFocalPoint(this.focalPoint);\n this.triggerUpdate();\n return this;\n };\n /**\n * Sets the focal point of this camera in world coordinates.\n *\n * support scalars or vectors.\n * @example\n * setFocalPoint(1, 2, 3);\n * setFocalPoint([1, 2, 3]);\n */\n Camera.prototype.setFocalPoint = function (x, y, z) {\n if (y === void 0) { y = this.focalPoint[1]; }\n if (z === void 0) { z = this.focalPoint[2]; }\n var up = vec3.fromValues(0, 1, 0);\n this.focalPoint = createVec3(x, y, z);\n if (this.trackingMode === CameraTrackingMode.CINEMATIC) {\n var d = vec3.subtract(vec3.create(), this.focalPoint, this.position);\n x = d[0];\n y = d[1];\n z = d[2];\n var r = vec3.length(d);\n var el = rad2deg(Math.asin(y / r));\n var az = 90 + rad2deg(Math.atan2(z, x));\n var m = mat4.create();\n mat4.rotateY(m, m, deg2rad(az));\n mat4.rotateX(m, m, deg2rad(el));\n up = vec3.transformMat4(vec3.create(), [0, 1, 0], m);\n }\n mat4.invert(this.matrix, mat4.lookAt(mat4.create(), this.position, this.focalPoint, up));\n this._getAxes();\n this._getDistance();\n this._getAngles();\n this.triggerUpdate();\n return this;\n };\n Camera.prototype.getDistance = function () {\n return this.distance;\n };\n Camera.prototype.getDistanceVector = function () {\n return this.distanceVector;\n };\n /**\n * Moves the camera towards/from the focal point.\n */\n Camera.prototype.setDistance = function (d) {\n if (this.distance === d || d < 0) {\n return this;\n }\n this.distance = d;\n if (this.distance < MIN_DISTANCE) {\n this.distance = MIN_DISTANCE;\n }\n this.dollyingStep = this.distance / 100;\n var pos = vec3.create();\n d = this.distance;\n var n = this.forward;\n var f = this.focalPoint;\n pos[0] = d * n[0] + f[0];\n pos[1] = d * n[1] + f[1];\n pos[2] = d * n[2] + f[2];\n this._setPosition(pos);\n this.triggerUpdate();\n return this;\n };\n Camera.prototype.setMaxDistance = function (d) {\n this.maxDistance = d;\n return this;\n };\n Camera.prototype.setMinDistance = function (d) {\n this.minDistance = d;\n return this;\n };\n /**\n * 设置相机方位角,不同相机模式下需要重新计算相机位置或者是视点位置\n * the azimuth in degrees\n */\n Camera.prototype.setAzimuth = function (az) {\n this.azimuth = getAngle(az);\n this.computeMatrix();\n this._getAxes();\n if (this.type === CameraType.ORBITING ||\n this.type === CameraType.EXPLORING) {\n this._getPosition();\n }\n else if (this.type === CameraType.TRACKING) {\n this._getFocalPoint();\n }\n this.triggerUpdate();\n return this;\n };\n Camera.prototype.getAzimuth = function () {\n return this.azimuth;\n };\n /**\n * 设置相机方位角,不同相机模式下需要重新计算相机位置或者是视点位置\n */\n Camera.prototype.setElevation = function (el) {\n this.elevation = getAngle(el);\n this.computeMatrix();\n this._getAxes();\n if (this.type === CameraType.ORBITING ||\n this.type === CameraType.EXPLORING) {\n this._getPosition();\n }\n else if (this.type === CameraType.TRACKING) {\n this._getFocalPoint();\n }\n this.triggerUpdate();\n return this;\n };\n Camera.prototype.getElevation = function () {\n return this.elevation;\n };\n /**\n * 设置相机方位角,不同相机模式下需要重新计算相机位置或者是视点位置\n */\n Camera.prototype.setRoll = function (angle) {\n this.roll = getAngle(angle);\n this.computeMatrix();\n this._getAxes();\n if (this.type === CameraType.ORBITING ||\n this.type === CameraType.EXPLORING) {\n this._getPosition();\n }\n else if (this.type === CameraType.TRACKING) {\n this._getFocalPoint();\n }\n this.triggerUpdate();\n return this;\n };\n Camera.prototype.getRoll = function () {\n return this.roll;\n };\n /**\n * 根据相机矩阵重新计算各种相机参数\n */\n Camera.prototype._update = function () {\n this._getAxes();\n this._getPosition();\n this._getDistance();\n this._getAngles();\n this._getOrthoMatrix();\n this.triggerUpdate();\n };\n /**\n * 计算相机矩阵\n */\n Camera.prototype.computeMatrix = function () {\n // 使用四元数描述 3D 旋转\n // @see https://xiaoiver.github.io/coding/2018/12/28/Camera-%E8%AE%BE%E8%AE%A1-%E4%B8%80.html\n var rotZ = quat$1.setAxisAngle(quat$1.create(), [0, 0, 1], deg2rad(this.roll));\n mat4.identity(this.matrix);\n // only consider HCS for EXPLORING and ORBITING cameras\n var rotX = quat$1.setAxisAngle(quat$1.create(), [1, 0, 0], deg2rad(((this.rotateWorld && this.type !== CameraType.TRACKING) ||\n this.type === CameraType.TRACKING\n ? 1\n : -1) * this.elevation));\n var rotY = quat$1.setAxisAngle(quat$1.create(), [0, 1, 0], deg2rad(((this.rotateWorld && this.type !== CameraType.TRACKING) ||\n this.type === CameraType.TRACKING\n ? 1\n : -1) * this.azimuth));\n var rotQ = quat$1.multiply(quat$1.create(), rotY, rotX);\n rotQ = quat$1.multiply(quat$1.create(), rotQ, rotZ);\n var rotMatrix = mat4.fromQuat(mat4.create(), rotQ);\n if (this.type === CameraType.ORBITING ||\n this.type === CameraType.EXPLORING) {\n mat4.translate(this.matrix, this.matrix, this.focalPoint);\n mat4.multiply(this.matrix, this.matrix, rotMatrix);\n mat4.translate(this.matrix, this.matrix, [0, 0, this.distance]);\n }\n else if (this.type === CameraType.TRACKING) {\n mat4.translate(this.matrix, this.matrix, this.position);\n mat4.multiply(this.matrix, this.matrix, rotMatrix);\n }\n };\n /**\n * Sets the camera position in the camera matrix\n */\n Camera.prototype._setPosition = function (x, y, z) {\n this.position = createVec3(x, y, z);\n var m = this.matrix;\n m[12] = this.position[0];\n m[13] = this.position[1];\n m[14] = this.position[2];\n m[15] = 1;\n this._getOrthoMatrix();\n };\n /**\n * Recalculates axes based on the current matrix\n */\n Camera.prototype._getAxes = function () {\n vec3.copy(this.right, createVec3(vec4.transformMat4(vec4.create(), [1, 0, 0, 0], this.matrix)));\n vec3.copy(this.up, createVec3(vec4.transformMat4(vec4.create(), [0, 1, 0, 0], this.matrix)));\n vec3.copy(this.forward, createVec3(vec4.transformMat4(vec4.create(), [0, 0, 1, 0], this.matrix)));\n vec3.normalize(this.right, this.right);\n vec3.normalize(this.up, this.up);\n vec3.normalize(this.forward, this.forward);\n };\n /**\n * Recalculates euler angles based on the current state\n */\n Camera.prototype._getAngles = function () {\n // Recalculates angles\n var x = this.distanceVector[0];\n var y = this.distanceVector[1];\n var z = this.distanceVector[2];\n var r = vec3.length(this.distanceVector);\n // FAST FAIL: If there is no distance we cannot compute angles\n if (r === 0) {\n this.elevation = 0;\n this.azimuth = 0;\n return;\n }\n if (this.type === CameraType.TRACKING) {\n this.elevation = rad2deg(Math.asin(y / r));\n this.azimuth = rad2deg(Math.atan2(-x, -z));\n }\n else {\n if (this.rotateWorld) {\n this.elevation = rad2deg(Math.asin(y / r));\n this.azimuth = rad2deg(Math.atan2(-x, -z));\n }\n else {\n this.elevation = -rad2deg(Math.asin(y / r));\n this.azimuth = -rad2deg(Math.atan2(-x, -z));\n }\n }\n };\n /**\n * 重新计算相机位置,只有 ORBITING 模式相机位置才会发生变化\n */\n Camera.prototype._getPosition = function () {\n vec3.copy(this.position, createVec3(vec4.transformMat4(vec4.create(), [0, 0, 0, 1], this.matrix)));\n // 相机位置变化,需要重新计算视距\n this._getDistance();\n };\n /**\n * 重新计算视点,只有 TRACKING 模式视点才会发生变化\n */\n Camera.prototype._getFocalPoint = function () {\n vec3.transformMat3(this.distanceVector, [0, 0, -this.distance], mat3.fromMat4(mat3.create(), this.matrix));\n vec3.add(this.focalPoint, this.position, this.distanceVector);\n // 视点变化,需要重新计算视距\n this._getDistance();\n };\n /**\n * 重新计算视距\n */\n Camera.prototype._getDistance = function () {\n this.distanceVector = vec3.subtract(vec3.create(), this.focalPoint, this.position);\n this.distance = vec3.length(this.distanceVector);\n this.dollyingStep = this.distance / 100;\n };\n Camera.prototype._getOrthoMatrix = function () {\n if (this.projectionMode !== CameraProjectionMode.ORTHOGRAPHIC) {\n return;\n }\n var position = this.position;\n var rotZ = quat$1.setAxisAngle(quat$1.create(), [0, 0, 1], (-this.roll * Math.PI) / 180);\n mat4.fromRotationTranslationScaleOrigin(this.orthoMatrix, rotZ, vec3.fromValues((this.rright - this.left) / 2 - position[0], (this.top - this.bottom) / 2 - position[1], 0), vec3.fromValues(this.zoom, this.zoom, 1), position);\n };\n Camera.prototype.triggerUpdate = function () {\n if (this.enableUpdate) {\n // update frustum\n var viewMatrix = this.getViewTransform();\n var vpMatrix = mat4.multiply(mat4.create(), this.getPerspective(), viewMatrix);\n this.getFrustum().extractFromVPMatrix(vpMatrix);\n this.eventEmitter.emit(CameraEvent.UPDATED);\n }\n };\n Camera.prototype.rotate = function (azimuth, elevation, roll) {\n throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);\n };\n Camera.prototype.pan = function (tx, ty) {\n throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);\n };\n Camera.prototype.dolly = function (value) {\n throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);\n };\n Camera.prototype.createLandmark = function (name, params) {\n throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);\n };\n Camera.prototype.gotoLandmark = function (name, options) {\n throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);\n };\n Camera.prototype.cancelLandmarkAnimation = function () {\n throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);\n };\n return Camera;\n}());\n\nfunction memoize(func, resolver) {\n if (typeof func !== 'function' ||\n (resolver != null && typeof resolver !== 'function')) {\n throw new TypeError('Expected a function');\n }\n var memoized = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var key = resolver ? resolver.apply(this, args) : args[0];\n var cache = memoized.cache;\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || Map)();\n return memoized;\n}\nmemoize.Cache = Map;\n\n// These units are iterated through, so be careful when adding or changing the\n// order.\nvar UnitType;\n(function (UnitType) {\n UnitType[UnitType[\"kUnknown\"] = 0] = \"kUnknown\";\n UnitType[UnitType[\"kNumber\"] = 1] = \"kNumber\";\n UnitType[UnitType[\"kPercentage\"] = 2] = \"kPercentage\";\n // Length units\n UnitType[UnitType[\"kEms\"] = 3] = \"kEms\";\n // kExs,\n UnitType[UnitType[\"kPixels\"] = 4] = \"kPixels\";\n // kCentimeters,\n // kMillimeters,\n // kInches,\n // kPoints,\n // kPicas,\n // kQuarterMillimeters,\n // https://drafts.csswg.org/css-values-4/#viewport-relative-lengths\n //\n // See also IsViewportPercentageLength.\n // kViewportWidth,\n // kViewportHeight,\n // kViewportInlineSize,\n // kViewportBlockSize,\n // kViewportMin,\n // kViewportMax,\n // kSmallViewportWidth,\n // kSmallViewportHeight,\n // kSmallViewportInlineSize,\n // kSmallViewportBlockSize,\n // kSmallViewportMin,\n // kSmallViewportMax,\n // kLargeViewportWidth,\n // kLargeViewportHeight,\n // kLargeViewportInlineSize,\n // kLargeViewportBlockSize,\n // kLargeViewportMin,\n // kLargeViewportMax,\n // kDynamicViewportWidth,\n // kDynamicViewportHeight,\n // kDynamicViewportInlineSize,\n // kDynamicViewportBlockSize,\n // kDynamicViewportMin,\n // kDynamicViewportMax,\n // https://drafts.csswg.org/css-contain-3/#container-lengths\n //\n // See also IsContainerPercentageLength.\n // kContainerWidth,\n // kContainerHeight,\n // kContainerInlineSize,\n // kContainerBlockSize,\n // kContainerMin,\n // kContainerMax,\n UnitType[UnitType[\"kRems\"] = 5] = \"kRems\";\n // kChs,\n // kUserUnits, // The SVG term for unitless lengths\n // Angle units\n UnitType[UnitType[\"kDegrees\"] = 6] = \"kDegrees\";\n UnitType[UnitType[\"kRadians\"] = 7] = \"kRadians\";\n UnitType[UnitType[\"kGradians\"] = 8] = \"kGradians\";\n UnitType[UnitType[\"kTurns\"] = 9] = \"kTurns\";\n // Time units\n UnitType[UnitType[\"kMilliseconds\"] = 10] = \"kMilliseconds\";\n UnitType[UnitType[\"kSeconds\"] = 11] = \"kSeconds\";\n // kHertz,\n // kKilohertz,\n // Resolution\n // kDotsPerPixel,\n // kDotsPerInch,\n // kDotsPerCentimeter,\n // Other units\n // kFraction,\n UnitType[UnitType[\"kInteger\"] = 12] = \"kInteger\";\n // This value is used to handle quirky margins in reflow roots (body, td,\n // and th) like WinIE. The basic idea is that a stylesheet can use the value\n // __qem (for quirky em) instead of em. When the quirky value is used, if\n // you're in quirks mode, the margin will collapse away inside a table cell.\n // This quirk is specified in the HTML spec but our impl is different.\n // TODO: Remove this. crbug.com/443952\n // kQuirkyEms,\n})(UnitType || (UnitType = {}));\nvar UnitCategory;\n(function (UnitCategory) {\n UnitCategory[UnitCategory[\"kUNumber\"] = 0] = \"kUNumber\";\n UnitCategory[UnitCategory[\"kUPercent\"] = 1] = \"kUPercent\";\n UnitCategory[UnitCategory[\"kULength\"] = 2] = \"kULength\";\n UnitCategory[UnitCategory[\"kUAngle\"] = 3] = \"kUAngle\";\n UnitCategory[UnitCategory[\"kUTime\"] = 4] = \"kUTime\";\n // kUFrequency,\n // kUResolution,\n UnitCategory[UnitCategory[\"kUOther\"] = 5] = \"kUOther\";\n})(UnitCategory || (UnitCategory = {}));\nvar ValueRange;\n(function (ValueRange) {\n ValueRange[ValueRange[\"kAll\"] = 0] = \"kAll\";\n ValueRange[ValueRange[\"kNonNegative\"] = 1] = \"kNonNegative\";\n ValueRange[ValueRange[\"kInteger\"] = 2] = \"kInteger\";\n ValueRange[ValueRange[\"kNonNegativeInteger\"] = 3] = \"kNonNegativeInteger\";\n ValueRange[ValueRange[\"kPositiveInteger\"] = 4] = \"kPositiveInteger\";\n})(ValueRange || (ValueRange = {}));\nvar Nested;\n(function (Nested) {\n Nested[Nested[\"kYes\"] = 0] = \"kYes\";\n Nested[Nested[\"kNo\"] = 1] = \"kNo\";\n})(Nested || (Nested = {}));\nvar ParenLess;\n(function (ParenLess) {\n ParenLess[ParenLess[\"kYes\"] = 0] = \"kYes\";\n ParenLess[ParenLess[\"kNo\"] = 1] = \"kNo\";\n})(ParenLess || (ParenLess = {}));\n\n// This file specifies the unit strings used in CSSPrimitiveValues.\nvar data = [\n {\n name: 'em',\n unit_type: UnitType.kEms,\n },\n // {\n // name: 'ex',\n // unit_type: UnitType.kExs,\n // },\n {\n name: 'px',\n unit_type: UnitType.kPixels,\n },\n // {\n // name: \"cm\",\n // unit_type: UnitType.kCentimeters,\n // },\n // {\n // name: \"mm\",\n // unit_type: UnitType.kMillimeters,\n // },\n // {\n // name: \"q\",\n // unit_type: UnitType.kQuarterMillimeters,\n // },\n // {\n // name: \"in\",\n // unit_type: UnitType.kInches,\n // },\n // {\n // name: \"pt\",\n // unit_type: UnitType.kPoints,\n // },\n // {\n // name: \"pc\",\n // unit_type: UnitType.kPicas,\n // },\n {\n name: 'deg',\n unit_type: UnitType.kDegrees,\n },\n {\n name: 'rad',\n unit_type: UnitType.kRadians,\n },\n {\n name: 'grad',\n unit_type: UnitType.kGradians,\n },\n {\n name: 'ms',\n unit_type: UnitType.kMilliseconds,\n },\n {\n name: 's',\n unit_type: UnitType.kSeconds,\n },\n // {\n // name: \"hz\",\n // unit_type: UnitType.kHertz,\n // },\n // {\n // name: \"khz\",\n // unit_type: UnitType.kKilohertz,\n // },\n // {\n // name: \"dpi\",\n // unit_type: \"kDotsPerInch\",\n // },\n // {\n // name: \"dpcm\",\n // unit_type: \"kDotsPerCentimeter\",\n // },\n // {\n // name: \"dppx\",\n // unit_type: \"kDotsPerPixel\",\n // },\n // {\n // name: \"x\",\n // unit_type: \"kDotsPerPixel\",\n // },\n // {\n // name: \"vw\",\n // unit_type: \"kViewportWidth\",\n // },\n // {\n // name: \"vh\",\n // unit_type: \"kViewportHeight\",\n // },\n // {\n // name: \"vi\",\n // unit_type: \"kViewportInlineSize\",\n // },\n // {\n // name: \"vb\",\n // unit_type: \"kViewportBlockSize\",\n // },\n // {\n // name: \"vmin\",\n // unit_type: UnitType.kViewportMin,\n // },\n // {\n // name: \"vmax\",\n // unit_type: UnitType.kViewportMax,\n // },\n // {\n // name: \"svw\",\n // unit_type: \"kSmallViewportWidth\",\n // },\n // {\n // name: \"svh\",\n // unit_type: \"kSmallViewportHeight\",\n // },\n // {\n // name: \"svi\",\n // unit_type: \"kSmallViewportInlineSize\",\n // },\n // {\n // name: \"svb\",\n // unit_type: \"kSmallViewportBlockSize\",\n // },\n // {\n // name: \"svmin\",\n // unit_type: \"kSmallViewportMin\",\n // },\n // {\n // name: \"svmax\",\n // unit_type: \"kSmallViewportMax\",\n // },\n // {\n // name: \"lvw\",\n // unit_type: \"kLargeViewportWidth\",\n // },\n // {\n // name: \"lvh\",\n // unit_type: \"kLargeViewportHeight\",\n // },\n // {\n // name: \"lvi\",\n // unit_type: \"kLargeViewportInlineSize\",\n // },\n // {\n // name: \"lvb\",\n // unit_type: \"kLargeViewportBlockSize\",\n // },\n // {\n // name: \"lvmin\",\n // unit_type: UnitType.kLargeViewportMin,\n // },\n // {\n // name: \"lvmax\",\n // unit_type: UnitType.kLargeViewportMax,\n // },\n // {\n // name: \"dvw\",\n // unit_type: UnitType.kDynamicViewportWidth,\n // },\n // {\n // name: \"dvh\",\n // unit_type: UnitType.kDynamicViewportHeight,\n // },\n // {\n // name: \"dvi\",\n // unit_type: UnitType.kDynamicViewportInlineSize,\n // },\n // {\n // name: \"dvb\",\n // unit_type: UnitType.kDynamicViewportBlockSize,\n // },\n // {\n // name: \"dvmin\",\n // unit_type: UnitType.kDynamicViewportMin,\n // },\n // {\n // name: \"dvmax\",\n // unit_type: UnitType.kDynamicViewportMax,\n // },\n // {\n // name: \"cqw\",\n // unit_type: UnitType.kContainerWidth,\n // },\n // {\n // name: \"cqh\",\n // unit_type: UnitType.kContainerHeight,\n // },\n // {\n // name: \"cqi\",\n // unit_type: UnitType.kContainerInlineSize,\n // },\n // {\n // name: \"cqb\",\n // unit_type: UnitType.kContainerBlockSize,\n // },\n // {\n // name: \"cqmin\",\n // unit_type: UnitType.kContainerMin,\n // },\n // {\n // name: \"cqmax\",\n // unit_type: UnitType.kContainerMax,\n // },\n {\n name: 'rem',\n unit_type: UnitType.kRems,\n },\n // {\n // name: 'fr',\n // unit_type: UnitType.kFraction,\n // },\n {\n name: 'turn',\n unit_type: UnitType.kTurns,\n },\n // {\n // name: 'ch',\n // unit_type: UnitType.kChs,\n // },\n // {\n // name: '__qem',\n // unit_type: UnitType.kQuirkyEms,\n // },\n];\nvar CSSStyleValueType;\n(function (CSSStyleValueType) {\n CSSStyleValueType[CSSStyleValueType[\"kUnknownType\"] = 0] = \"kUnknownType\";\n CSSStyleValueType[CSSStyleValueType[\"kUnparsedType\"] = 1] = \"kUnparsedType\";\n CSSStyleValueType[CSSStyleValueType[\"kKeywordType\"] = 2] = \"kKeywordType\";\n // Start of CSSNumericValue subclasses\n CSSStyleValueType[CSSStyleValueType[\"kUnitType\"] = 3] = \"kUnitType\";\n CSSStyleValueType[CSSStyleValueType[\"kSumType\"] = 4] = \"kSumType\";\n CSSStyleValueType[CSSStyleValueType[\"kProductType\"] = 5] = \"kProductType\";\n CSSStyleValueType[CSSStyleValueType[\"kNegateType\"] = 6] = \"kNegateType\";\n CSSStyleValueType[CSSStyleValueType[\"kInvertType\"] = 7] = \"kInvertType\";\n CSSStyleValueType[CSSStyleValueType[\"kMinType\"] = 8] = \"kMinType\";\n CSSStyleValueType[CSSStyleValueType[\"kMaxType\"] = 9] = \"kMaxType\";\n CSSStyleValueType[CSSStyleValueType[\"kClampType\"] = 10] = \"kClampType\";\n // End of CSSNumericValue subclasses\n CSSStyleValueType[CSSStyleValueType[\"kTransformType\"] = 11] = \"kTransformType\";\n CSSStyleValueType[CSSStyleValueType[\"kPositionType\"] = 12] = \"kPositionType\";\n CSSStyleValueType[CSSStyleValueType[\"kURLImageType\"] = 13] = \"kURLImageType\";\n CSSStyleValueType[CSSStyleValueType[\"kColorType\"] = 14] = \"kColorType\";\n CSSStyleValueType[CSSStyleValueType[\"kUnsupportedColorType\"] = 15] = \"kUnsupportedColorType\";\n})(CSSStyleValueType || (CSSStyleValueType = {}));\n// function parseCSSStyleValue(propertyName: string, value: string): CSSStyleValue[] {\n// // const propertyId = cssPropertyID(propertyName);\n// // if (propertyId === CSSPropertyID.kInvalid) {\n// // return [];\n// // }\n// // const customPropertyName = propertyId === CSSPropertyID.kVariable ? propertyName : null;\n// // return fromString(propertyId, customPropertyName, value);\n// return [];\n// }\nvar stringToUnitType = function (name) {\n return data.find(function (item) { return item.name === name; }).unit_type;\n};\nvar unitFromName = function (name) {\n if (!name) {\n return UnitType.kUnknown;\n }\n if (name === 'number') {\n return UnitType.kNumber;\n }\n if (name === 'percent' || name === '%') {\n return UnitType.kPercentage;\n }\n return stringToUnitType(name);\n};\nvar unitTypeToUnitCategory = function (type) {\n switch (type) {\n case UnitType.kNumber:\n case UnitType.kInteger:\n return UnitCategory.kUNumber;\n case UnitType.kPercentage:\n return UnitCategory.kUPercent;\n case UnitType.kPixels:\n // case UnitType.kCentimeters:\n // case UnitType.kMillimeters:\n // case UnitType.kQuarterMillimeters:\n // case UnitType.kInches:\n // case UnitType.kPoints:\n // case UnitType.kPicas:\n // case UnitType.kUserUnits:\n return UnitCategory.kULength;\n case UnitType.kMilliseconds:\n case UnitType.kSeconds:\n return UnitCategory.kUTime;\n case UnitType.kDegrees:\n case UnitType.kRadians:\n case UnitType.kGradians:\n case UnitType.kTurns:\n return UnitCategory.kUAngle;\n // case UnitType.kHertz:\n // case UnitType.kKilohertz:\n // return UnitCategory.kUFrequency;\n // case UnitType.kDotsPerPixel:\n // case UnitType.kDotsPerInch:\n // case UnitType.kDotsPerCentimeter:\n // return UnitCategory.kUResolution;\n default:\n return UnitCategory.kUOther;\n }\n};\nvar canonicalUnitTypeForCategory = function (category) {\n // The canonical unit type is chosen according to the way\n // CSSPropertyParser.ValidUnit() chooses the default unit in each category\n // (based on unitflags).\n switch (category) {\n case UnitCategory.kUNumber:\n return UnitType.kNumber;\n case UnitCategory.kULength:\n return UnitType.kPixels;\n case UnitCategory.kUPercent:\n return UnitType.kPercentage;\n // return UnitType.kUnknown; // Cannot convert between numbers and percent.\n case UnitCategory.kUTime:\n return UnitType.kSeconds;\n case UnitCategory.kUAngle:\n return UnitType.kDegrees;\n // case UnitCategory.kUFrequency:\n // return UnitType.kHertz;\n // case UnitCategory.kUResolution:\n // return UnitType.kDotsPerPixel;\n default:\n return UnitType.kUnknown;\n }\n};\n/**\n * @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/css_primitive_value.cc#353\n */\nvar conversionToCanonicalUnitsScaleFactor = function (unit_type) {\n var factor = 1.0;\n // FIXME: the switch can be replaced by an array of scale factors.\n switch (unit_type) {\n // These are \"canonical\" units in their respective categories.\n case UnitType.kPixels:\n // case UnitType.kUserUnits:\n case UnitType.kDegrees:\n case UnitType.kSeconds:\n // case UnitType.kHertz:\n break;\n case UnitType.kMilliseconds:\n factor = 0.001;\n break;\n // case UnitType.kCentimeters:\n // // factor = kCssPixelsPerCentimeter;\n // break;\n // case UnitType.kDotsPerCentimeter:\n // // factor = 1 / kCssPixelsPerCentimeter;\n // break;\n // case UnitType.kMillimeters:\n // // factor = kCssPixelsPerMillimeter;\n // break;\n // case UnitType.kQuarterMillimeters:\n // // factor = kCssPixelsPerQuarterMillimeter;\n // break;\n // case UnitType.kInches:\n // // factor = kCssPixelsPerInch;\n // break;\n // case UnitType.kDotsPerInch:\n // // factor = 1 / kCssPixelsPerInch;\n // break;\n // case UnitType.kPoints:\n // // factor = kCssPixelsPerPoint;\n // break;\n // case UnitType.kPicas:\n // // factor = kCssPixelsPerPica;\n // break;\n case UnitType.kRadians:\n factor = 180 / Math.PI;\n break;\n case UnitType.kGradians:\n factor = 0.9;\n break;\n case UnitType.kTurns:\n factor = 360;\n break;\n }\n return factor;\n};\nvar unitTypeToString = function (type) {\n switch (type) {\n case UnitType.kNumber:\n case UnitType.kInteger:\n // case UnitType.kUserUnits:\n return '';\n case UnitType.kPercentage:\n return '%';\n case UnitType.kEms:\n // case UnitType.kQuirkyEms:\n return 'em';\n // case UnitType.kExs:\n // return 'ex';\n case UnitType.kRems:\n return 'rem';\n // case UnitType.kChs:\n // return 'ch';\n case UnitType.kPixels:\n return 'px';\n // case UnitType.kCentimeters:\n // return 'cm';\n // case UnitType.kDotsPerPixel:\n // return 'dppx';\n // case UnitType.kDotsPerInch:\n // return 'dpi';\n // case UnitType.kDotsPerCentimeter:\n // return 'dpcm';\n // case UnitType.kMillimeters:\n // return 'mm';\n // case UnitType.kQuarterMillimeters:\n // return 'q';\n // case UnitType.kInches:\n // return 'in';\n // case UnitType.kPoints:\n // return 'pt';\n // case UnitType.kPicas:\n // return 'pc';\n case UnitType.kDegrees:\n return 'deg';\n case UnitType.kRadians:\n return 'rad';\n case UnitType.kGradians:\n return 'grad';\n case UnitType.kMilliseconds:\n return 'ms';\n case UnitType.kSeconds:\n return 's';\n // case UnitType.kHertz:\n // return 'hz';\n // case UnitType.kKilohertz:\n // return 'khz';\n case UnitType.kTurns:\n return 'turn';\n }\n return '';\n};\n/**\n * CSSStyleValue is the base class for all CSS values accessible from Typed OM.\n * Values that are not yet supported as specific types are also returned as base CSSStyleValues.\n *\n * Spec @see https://drafts.css-houdini.org/css-typed-om/#stylevalue-objects\n * Docs @see https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleValue\n */\nvar CSSStyleValue = /** @class */ (function () {\n function CSSStyleValue() {\n }\n // static parse(propertyName: string, value: string): CSSStyleValue {\n // return parseCSSStyleValue(propertyName, value)[0];\n // }\n // static parseAll(propertyName: string, value: string): CSSStyleValue[] {\n // return parseCSSStyleValue(propertyName, value);\n // }\n CSSStyleValue.isAngle = function (unit) {\n return (unit === UnitType.kDegrees ||\n unit === UnitType.kRadians ||\n unit === UnitType.kGradians ||\n unit === UnitType.kTurns);\n };\n // static isViewportPercentageLength(type: UnitType) {\n // return type >= UnitType.kViewportWidth && type <= UnitType.kDynamicViewportMax;\n // }\n // static isContainerPercentageLength(type: UnitType) {\n // return type >= UnitType.kContainerWidth && type <= UnitType.kContainerMax;\n // }\n CSSStyleValue.isLength = function (type) {\n // return (type >= UnitType.kEms && type <= UnitType.kUserUnits) || type == UnitType.kQuirkyEms;\n return type >= UnitType.kEms && type < UnitType.kDegrees;\n };\n CSSStyleValue.isRelativeUnit = function (type) {\n return (type === UnitType.kPercentage ||\n type === UnitType.kEms ||\n // type === UnitType.kExs ||\n type === UnitType.kRems\n // type === UnitType.kChs ||\n // this.isViewportPercentageLength(type) ||\n // this.isContainerPercentageLength(type)\n );\n };\n CSSStyleValue.isTime = function (unit) {\n return unit === UnitType.kSeconds || unit === UnitType.kMilliseconds;\n };\n // protected abstract toCSSValue(): CSSValue;\n CSSStyleValue.prototype.toString = function () {\n return this.buildCSSText(Nested.kNo, ParenLess.kNo, '');\n };\n CSSStyleValue.prototype.isNumericValue = function () {\n return (this.getType() >= CSSStyleValueType.kUnitType &&\n this.getType() <= CSSStyleValueType.kClampType);\n };\n return CSSStyleValue;\n}());\n\n/**\n * CSSColorValue is the base class used for the various CSS color interfaces.\n *\n * @see https://drafts.css-houdini.org/css-typed-om-1/#colorvalue-objects\n */\nvar CSSColorValue = /** @class */ (function (_super) {\n __extends(CSSColorValue, _super);\n function CSSColorValue(colorSpace) {\n var _this = _super.call(this) || this;\n _this.colorSpace = colorSpace;\n return _this;\n }\n CSSColorValue.prototype.getType = function () {\n return CSSStyleValueType.kColorType;\n };\n // buildCSSText(n: Nested, p: ParenLess, result: string): string {\n // let text = '';\n // if (this.colorSpace === 'rgb') {\n // text = `rgba(${this.channels.join(',')},${this.alpha})`;\n // }\n // return (result += text);\n // }\n /**\n * @see https://drafts.css-houdini.org/css-typed-om-1/#dom-csscolorvalue-to\n */\n CSSColorValue.prototype.to = function (colorSpace) {\n return this;\n };\n return CSSColorValue;\n}(CSSStyleValue));\n\nvar GradientType;\n(function (GradientType) {\n GradientType[GradientType[\"Constant\"] = 0] = \"Constant\";\n GradientType[GradientType[\"LinearGradient\"] = 1] = \"LinearGradient\";\n GradientType[GradientType[\"RadialGradient\"] = 2] = \"RadialGradient\";\n})(GradientType || (GradientType = {}));\nvar CSSGradientValue = /** @class */ (function (_super) {\n __extends(CSSGradientValue, _super);\n function CSSGradientValue(type, value) {\n var _this = _super.call(this) || this;\n _this.type = type;\n _this.value = value;\n return _this;\n }\n CSSGradientValue.prototype.clone = function () {\n return new CSSGradientValue(this.type, this.value);\n };\n CSSGradientValue.prototype.buildCSSText = function (n, p, result) {\n return result;\n };\n CSSGradientValue.prototype.getType = function () {\n return CSSStyleValueType.kColorType;\n };\n return CSSGradientValue;\n}(CSSStyleValue));\n\n/**\n * CSSKeywordValue represents CSS Values that are specified as keywords\n * eg. 'initial'\n * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSKeywordValue\n * @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_keyword_value.idl\n */\nvar CSSKeywordValue = /** @class */ (function (_super) {\n __extends(CSSKeywordValue, _super);\n function CSSKeywordValue(value) {\n var _this = _super.call(this) || this;\n _this.value = value;\n return _this;\n }\n CSSKeywordValue.prototype.clone = function () {\n return new CSSKeywordValue(this.value);\n };\n CSSKeywordValue.prototype.getType = function () {\n return CSSStyleValueType.kKeywordType;\n };\n CSSKeywordValue.prototype.buildCSSText = function (n, p, result) {\n return result + this.value;\n };\n return CSSKeywordValue;\n}(CSSStyleValue));\n\nvar camelCase = memoize(function (str) {\n if (str === void 0) { str = ''; }\n return str.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });\n});\nvar kebabize = function (str) {\n return str\n .split('')\n .map(function (letter, idx) {\n return letter.toUpperCase() === letter\n ? \"\".concat(idx !== 0 ? '-' : '').concat(letter.toLowerCase())\n : letter;\n })\n .join('');\n};\n\nfunction DCHECK(bool) {\n if (!bool) {\n throw new Error();\n }\n}\nfunction isFunction(func) {\n return typeof func === 'function';\n}\nfunction isSymbol(value) {\n // @see https://github.com/lodash/lodash/blob/master/isSymbol.js\n return typeof value === 'symbol';\n}\nvar definedProps = function (obj) {\n return Object.fromEntries(Object.entries(obj).filter(function (_a) {\n var _b = __read(_a, 2), v = _b[1];\n return v !== undefined;\n }));\n};\nvar FORMAT_ATTR_MAP = {\n d: {\n alias: 'path',\n },\n strokeDasharray: {\n alias: 'lineDash',\n },\n strokeWidth: {\n alias: 'lineWidth',\n },\n textAnchor: {\n alias: 'textAlign',\n },\n src: {\n alias: 'img',\n },\n};\nvar formatAttributeName = memoize(function (name) {\n var attributeName = camelCase(name);\n var map = FORMAT_ATTR_MAP[attributeName];\n attributeName = (map === null || map === void 0 ? void 0 : map.alias) || attributeName;\n return attributeName;\n});\n\n// type CSSNumericBaseType =\n// | 'length'\n// | 'angle'\n// | 'time'\n// | 'frequency'\n// | 'resolution'\n// | 'flex'\n// | 'percent';\n// https://drafts.css-houdini.org/css-typed-om/#dictdef-cssnumerictype\n// interface CSSNumericType {\n// length: number;\n// angle: number;\n// time: number;\n// frequency: number;\n// resolution: number;\n// flex: number;\n// percent: number;\n// percentHint: CSSNumericBaseType;\n// }\nvar formatInfinityOrNaN = function (number, suffix) {\n if (suffix === void 0) { suffix = ''; }\n var result = '';\n if (!Number.isFinite(number)) {\n if (number > 0)\n result = 'infinity';\n else\n result = '-infinity';\n }\n else {\n DCHECK(Number.isNaN(number));\n result = 'NaN';\n }\n return (result += suffix);\n};\nvar toCanonicalUnit = function (unit) {\n return canonicalUnitTypeForCategory(unitTypeToUnitCategory(unit));\n};\n/**\n * CSSNumericValue is the base class for numeric and length typed CSS Values.\n * @see https://drafts.css-houdini.org/css-typed-om/#numeric-objects\n * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSNumericValue\n * @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_numeric_value.idl\n */\n/**\n * Represents numeric values that can be expressed as a single number plus a\n * unit (or a naked number or percentage).\n * @see https://drafts.css-houdini.org/css-typed-om/#cssunitvalue\n */\nvar CSSUnitValue = /** @class */ (function (_super) {\n __extends(CSSUnitValue, _super);\n function CSSUnitValue(value, unitOrName) {\n if (unitOrName === void 0) { unitOrName = UnitType.kNumber; }\n var _this = _super.call(this) || this;\n var unit;\n if (typeof unitOrName === 'string') {\n unit = unitFromName(unitOrName);\n }\n else {\n unit = unitOrName;\n }\n _this.unit = unit;\n _this.value = value;\n return _this;\n }\n CSSUnitValue.prototype.clone = function () {\n return new CSSUnitValue(this.value, this.unit);\n };\n CSSUnitValue.prototype.equals = function (other) {\n var other_unit_value = other;\n return (this.value === other_unit_value.value &&\n this.unit === other_unit_value.unit);\n };\n CSSUnitValue.prototype.getType = function () {\n return CSSStyleValueType.kUnitType;\n };\n CSSUnitValue.prototype.convertTo = function (target_unit) {\n if (this.unit === target_unit) {\n return new CSSUnitValue(this.value, this.unit);\n }\n // Instead of defining the scale factors for every unit to every other unit,\n // we simply convert to the canonical unit and back since we already have\n // the scale factors for canonical units.\n var canonical_unit = toCanonicalUnit(this.unit);\n if (canonical_unit !== toCanonicalUnit(target_unit) ||\n canonical_unit === UnitType.kUnknown) {\n return null;\n }\n var scale_factor = conversionToCanonicalUnitsScaleFactor(this.unit) /\n conversionToCanonicalUnitsScaleFactor(target_unit);\n return new CSSUnitValue(this.value * scale_factor, target_unit);\n };\n CSSUnitValue.prototype.buildCSSText = function (n, p, result) {\n var text;\n switch (this.unit) {\n case UnitType.kUnknown:\n // FIXME\n break;\n case UnitType.kInteger:\n text = Number(this.value).toFixed(0);\n break;\n case UnitType.kNumber:\n case UnitType.kPercentage:\n case UnitType.kEms:\n // case UnitType.kQuirkyEms:\n // case UnitType.kExs:\n case UnitType.kRems:\n // case UnitType.kChs:\n case UnitType.kPixels:\n // case UnitType.kCentimeters:\n // case UnitType.kDotsPerPixel:\n // case UnitType.kDotsPerInch:\n // case UnitType.kDotsPerCentimeter:\n // case UnitType.kMillimeters:\n // case UnitType.kQuarterMillimeters:\n // case UnitType.kInches:\n // case UnitType.kPoints:\n // case UnitType.kPicas:\n // case UnitType.kUserUnits:\n case UnitType.kDegrees:\n case UnitType.kRadians:\n case UnitType.kGradians:\n case UnitType.kMilliseconds:\n case UnitType.kSeconds:\n // case UnitType.kHertz:\n // case UnitType.kKilohertz:\n case UnitType.kTurns: // case UnitType.kContainerMax: { // case UnitType.kContainerMin: // case UnitType.kContainerBlockSize: // case UnitType.kContainerInlineSize: // case UnitType.kContainerHeight: // case UnitType.kContainerWidth: // case UnitType.kDynamicViewportMax: // case UnitType.kDynamicViewportMin: // case UnitType.kDynamicViewportBlockSize: // case UnitType.kDynamicViewportInlineSize: // case UnitType.kDynamicViewportHeight: // case UnitType.kDynamicViewportWidth: // case UnitType.kLargeViewportMax: // case UnitType.kLargeViewportMin: // case UnitType.kLargeViewportBlockSize: // case UnitType.kLargeViewportInlineSize: // case UnitType.kLargeViewportHeight: // case UnitType.kLargeViewportWidth: // case UnitType.kSmallViewportMax: // case UnitType.kSmallViewportMin: // case UnitType.kSmallViewportBlockSize: // case UnitType.kSmallViewportInlineSize: // case UnitType.kSmallViewportHeight: // case UnitType.kSmallViewportWidth: // case UnitType.kViewportMax: // case UnitType.kViewportMin: // case UnitType.kViewportBlockSize: // case UnitType.kViewportInlineSize: // case UnitType.kViewportHeight: // case UnitType.kViewportWidth: // case UnitType.kFraction:\n {\n var kMinInteger = -999999;\n var kMaxInteger = 999999;\n var value = this.value;\n var unit = unitTypeToString(this.unit);\n if (value < kMinInteger || value > kMaxInteger) {\n var unit_1 = unitTypeToString(this.unit);\n if (!Number.isFinite(value) || Number.isNaN(value)) {\n text = formatInfinityOrNaN(value, unit_1);\n }\n else {\n text = value + (unit_1 || '');\n }\n }\n else {\n text = \"\".concat(value).concat(unit);\n }\n }\n }\n result += text;\n return result;\n };\n return CSSUnitValue;\n}(CSSStyleValue));\nvar Opx = new CSSUnitValue(0, 'px');\nnew CSSUnitValue(1, 'px');\nvar Odeg = new CSSUnitValue(0, 'deg');\n\n/**\n * The CSSRGB class represents the CSS rgb()/rgba() functions.\n *\n * @see https://drafts.css-houdini.org/css-typed-om-1/#cssrgb\n */\nvar CSSRGB = /** @class */ (function (_super) {\n __extends(CSSRGB, _super);\n function CSSRGB(r, g, b, alpha, \n /**\n * 'transparent' & 'none' has the same rgba data\n */\n isNone) {\n if (alpha === void 0) { alpha = 1; }\n if (isNone === void 0) { isNone = false; }\n var _this = _super.call(this, 'rgb') || this;\n _this.r = r;\n _this.g = g;\n _this.b = b;\n _this.alpha = alpha;\n _this.isNone = isNone;\n return _this;\n }\n CSSRGB.prototype.clone = function () {\n return new CSSRGB(this.r, this.g, this.b, this.alpha);\n };\n CSSRGB.prototype.buildCSSText = function (n, p, result) {\n return result + \"rgba(\".concat(this.r, \",\").concat(this.g, \",\").concat(this.b, \",\").concat(this.alpha, \")\");\n };\n return CSSRGB;\n}(CSSColorValue));\n\n/**\n * CSSKeywordValue\n */\nvar unsetKeywordValue = new CSSKeywordValue('unset');\nvar initialKeywordValue = new CSSKeywordValue('initial');\nvar inheritKeywordValue = new CSSKeywordValue('inherit');\nvar keywordCache = {\n '': unsetKeywordValue,\n unset: unsetKeywordValue,\n initial: initialKeywordValue,\n inherit: inheritKeywordValue,\n};\nvar getOrCreateKeyword = function (name) {\n if (!keywordCache[name]) {\n keywordCache[name] = new CSSKeywordValue(name);\n }\n return keywordCache[name];\n};\n/**\n * CSSColor\n */\nvar noneColor = new CSSRGB(0, 0, 0, 0, true);\nvar transparentColor = new CSSRGB(0, 0, 0, 0);\nvar getOrCreateRGBA = memoize(function (r, g, b, a) {\n return new CSSRGB(r, g, b, a);\n}, function (r, g, b, a) {\n return \"rgba(\".concat(r, \",\").concat(g, \",\").concat(b, \",\").concat(a, \")\");\n});\n// export const getOrCreateUnitValue = memoize(\n// (value: number, unitOrName: UnitType | string = UnitType.kNumber) => {\n// return new CSSUnitValue(value, unitOrName);\n// },\n// (value: number, unitOrName: UnitType | string = UnitType.kNumber) => {\n// return `${value}${unitOrName}`;\n// },\n// );\nvar getOrCreateUnitValue = function (value, unitOrName) {\n if (unitOrName === void 0) { unitOrName = UnitType.kNumber; }\n return new CSSUnitValue(value, unitOrName);\n};\nvar PECENTAGE_50 = new CSSUnitValue(50, '%');\n\n/**\n * @see https://doc.babylonjs.com/how_to/optimizing_your_scene#changing-mesh-culling-strategy\n */\nvar Strategy;\n(function (Strategy) {\n Strategy[Strategy[\"Standard\"] = 0] = \"Standard\";\n})(Strategy || (Strategy = {}));\n\nvar SortReason;\n(function (SortReason) {\n SortReason[SortReason[\"ADDED\"] = 0] = \"ADDED\";\n SortReason[SortReason[\"REMOVED\"] = 1] = \"REMOVED\";\n SortReason[SortReason[\"Z_INDEX_CHANGED\"] = 2] = \"Z_INDEX_CHANGED\";\n})(SortReason || (SortReason = {}));\n\nvar EMPTY_PARSED_PATH = {\n absolutePath: [],\n hasArc: false,\n segments: [],\n polygons: [],\n polylines: [],\n curve: null,\n totalLength: 0,\n rect: new Rectangle(0, 0, 0, 0),\n};\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type\n */\nvar PropertySyntax;\n(function (PropertySyntax) {\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#coordinate\n */\n PropertySyntax[\"COORDINATE\"] = \"\";\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#color\n */\n PropertySyntax[\"COLOR\"] = \"\";\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#paint\n */\n PropertySyntax[\"PAINT\"] = \"\";\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#number\n */\n PropertySyntax[\"NUMBER\"] = \"\";\n /**\n * @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/angle\n */\n PropertySyntax[\"ANGLE\"] = \"\";\n /**\n * with range 0..1\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#opacity_value\n */\n PropertySyntax[\"OPACITY_VALUE\"] = \"\";\n /**\n * with range 0..Infinity\n */\n PropertySyntax[\"SHADOW_BLUR\"] = \"\";\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#length\n */\n PropertySyntax[\"LENGTH\"] = \"\";\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#percentage\n */\n PropertySyntax[\"PERCENTAGE\"] = \"\";\n PropertySyntax[\"LENGTH_PERCENTAGE\"] = \" | \";\n PropertySyntax[\"LENGTH_PERCENTAGE_12\"] = \"[ | ]{1,2}\";\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/margin#formal_syntax\n */\n PropertySyntax[\"LENGTH_PERCENTAGE_14\"] = \"[ | ]{1,4}\";\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#list-of-ts\n */\n PropertySyntax[\"LIST_OF_POINTS\"] = \"\";\n PropertySyntax[\"PATH\"] = \"\";\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/filter#formal_syntax\n */\n PropertySyntax[\"FILTER\"] = \"\";\n PropertySyntax[\"Z_INDEX\"] = \"\";\n PropertySyntax[\"OFFSET_DISTANCE\"] = \"\";\n PropertySyntax[\"DEFINED_PATH\"] = \"\";\n PropertySyntax[\"MARKER\"] = \"\";\n PropertySyntax[\"TRANSFORM\"] = \"\";\n PropertySyntax[\"TRANSFORM_ORIGIN\"] = \"\";\n PropertySyntax[\"TEXT\"] = \"\";\n PropertySyntax[\"TEXT_TRANSFORM\"] = \"\";\n})(PropertySyntax || (PropertySyntax = {}));\n\n/**\n * borrow from gradient-parser, but we delete some browser compatible prefix such as `-webkit-`\n * @see https://github.com/rafaelcaricio/gradient-parser\n */\nfunction colorStopToString(colorStop) {\n var type = colorStop.type, value = colorStop.value;\n if (type === 'hex') {\n return \"#\".concat(value);\n }\n else if (type === 'literal') {\n return value;\n }\n else if (type === 'rgb') {\n return \"rgb(\".concat(value.join(','), \")\");\n }\n else {\n return \"rgba(\".concat(value.join(','), \")\");\n }\n}\nvar parseGradient$1 = (function () {\n var tokens = {\n linearGradient: /^(linear\\-gradient)/i,\n repeatingLinearGradient: /^(repeating\\-linear\\-gradient)/i,\n radialGradient: /^(radial\\-gradient)/i,\n repeatingRadialGradient: /^(repeating\\-radial\\-gradient)/i,\n /**\n * @see https://projects.verou.me/conic-gradient/\n */\n conicGradient: /^(conic\\-gradient)/i,\n sideOrCorner: /^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,\n extentKeywords: /^(closest\\-side|closest\\-corner|farthest\\-side|farthest\\-corner|contain|cover)/,\n positionKeywords: /^(left|center|right|top|bottom)/i,\n pixelValue: /^(-?(([0-9]*\\.[0-9]+)|([0-9]+\\.?)))px/,\n percentageValue: /^(-?(([0-9]*\\.[0-9]+)|([0-9]+\\.?)))\\%/,\n emValue: /^(-?(([0-9]*\\.[0-9]+)|([0-9]+\\.?)))em/,\n angleValue: /^(-?(([0-9]*\\.[0-9]+)|([0-9]+\\.?)))deg/,\n startCall: /^\\(/,\n endCall: /^\\)/,\n comma: /^,/,\n hexColor: /^\\#([0-9a-fA-F]+)/,\n literalColor: /^([a-zA-Z]+)/,\n rgbColor: /^rgb/i,\n rgbaColor: /^rgba/i,\n number: /^(([0-9]*\\.[0-9]+)|([0-9]+\\.?))/,\n };\n var input = '';\n function error(msg) {\n throw new Error(input + ': ' + msg);\n }\n function getAST() {\n var ast = matchListDefinitions();\n if (input.length > 0) {\n error('Invalid input not EOF');\n }\n return ast;\n }\n function matchListDefinitions() {\n return matchListing(matchDefinition);\n }\n function matchDefinition() {\n return (matchGradient('linear-gradient', tokens.linearGradient, matchLinearOrientation) ||\n matchGradient('repeating-linear-gradient', tokens.repeatingLinearGradient, matchLinearOrientation) ||\n matchGradient('radial-gradient', tokens.radialGradient, matchListRadialOrientations) ||\n matchGradient('repeating-radial-gradient', tokens.repeatingRadialGradient, matchListRadialOrientations) ||\n matchGradient('conic-gradient', tokens.conicGradient, matchListRadialOrientations));\n }\n function matchGradient(gradientType, pattern, orientationMatcher) {\n return matchCall(pattern, function (captures) {\n var orientation = orientationMatcher();\n if (orientation) {\n if (!scan(tokens.comma)) {\n error('Missing comma before color stops');\n }\n }\n return {\n type: gradientType,\n orientation: orientation,\n colorStops: matchListing(matchColorStop),\n };\n });\n }\n function matchCall(pattern, callback) {\n var captures = scan(pattern);\n if (captures) {\n if (!scan(tokens.startCall)) {\n error('Missing (');\n }\n var result = callback(captures);\n if (!scan(tokens.endCall)) {\n error('Missing )');\n }\n return result;\n }\n }\n function matchLinearOrientation() {\n return matchSideOrCorner() || matchAngle();\n }\n function matchSideOrCorner() {\n return match('directional', tokens.sideOrCorner, 1);\n }\n function matchAngle() {\n return match('angular', tokens.angleValue, 1);\n }\n function matchListRadialOrientations() {\n var radialOrientations, radialOrientation = matchRadialOrientation(), lookaheadCache;\n if (radialOrientation) {\n radialOrientations = [];\n radialOrientations.push(radialOrientation);\n lookaheadCache = input;\n if (scan(tokens.comma)) {\n radialOrientation = matchRadialOrientation();\n if (radialOrientation) {\n radialOrientations.push(radialOrientation);\n }\n else {\n input = lookaheadCache;\n }\n }\n }\n return radialOrientations;\n }\n function matchRadialOrientation() {\n var radialType = matchCircle() || matchEllipse();\n if (radialType) {\n // @ts-ignore\n radialType.at = matchAtPosition();\n }\n else {\n var extent = matchExtentKeyword();\n if (extent) {\n radialType = extent;\n var positionAt = matchAtPosition();\n if (positionAt) {\n // @ts-ignore\n radialType.at = positionAt;\n }\n }\n else {\n var defaultPosition = matchPositioning();\n if (defaultPosition) {\n radialType = {\n type: 'default-radial',\n // @ts-ignore\n at: defaultPosition,\n };\n }\n }\n }\n return radialType;\n }\n function matchCircle() {\n var circle = match('shape', /^(circle)/i, 0);\n if (circle) {\n // @ts-ignore\n circle.style = matchLength() || matchExtentKeyword();\n }\n return circle;\n }\n function matchEllipse() {\n var ellipse = match('shape', /^(ellipse)/i, 0);\n if (ellipse) {\n // @ts-ignore\n ellipse.style = matchDistance() || matchExtentKeyword();\n }\n return ellipse;\n }\n function matchExtentKeyword() {\n return match('extent-keyword', tokens.extentKeywords, 1);\n }\n function matchAtPosition() {\n if (match('position', /^at/, 0)) {\n var positioning = matchPositioning();\n if (!positioning) {\n error('Missing positioning value');\n }\n return positioning;\n }\n }\n function matchPositioning() {\n var location = matchCoordinates();\n if (location.x || location.y) {\n return {\n type: 'position',\n value: location,\n };\n }\n }\n function matchCoordinates() {\n return {\n x: matchDistance(),\n y: matchDistance(),\n };\n }\n function matchListing(matcher) {\n var captures = matcher();\n var result = [];\n if (captures) {\n result.push(captures);\n while (scan(tokens.comma)) {\n captures = matcher();\n if (captures) {\n result.push(captures);\n }\n else {\n error('One extra comma');\n }\n }\n }\n return result;\n }\n function matchColorStop() {\n var color = matchColor();\n if (!color) {\n error('Expected color definition');\n }\n color.length = matchDistance();\n return color;\n }\n function matchColor() {\n return (matchHexColor() ||\n matchRGBAColor() ||\n matchRGBColor() ||\n matchLiteralColor());\n }\n function matchLiteralColor() {\n return match('literal', tokens.literalColor, 0);\n }\n function matchHexColor() {\n return match('hex', tokens.hexColor, 1);\n }\n function matchRGBColor() {\n return matchCall(tokens.rgbColor, function () {\n return {\n type: 'rgb',\n value: matchListing(matchNumber),\n };\n });\n }\n function matchRGBAColor() {\n return matchCall(tokens.rgbaColor, function () {\n return {\n type: 'rgba',\n value: matchListing(matchNumber),\n };\n });\n }\n function matchNumber() {\n return scan(tokens.number)[1];\n }\n function matchDistance() {\n return (match('%', tokens.percentageValue, 1) ||\n matchPositionKeyword() ||\n matchLength());\n }\n function matchPositionKeyword() {\n return match('position-keyword', tokens.positionKeywords, 1);\n }\n function matchLength() {\n return match('px', tokens.pixelValue, 1) || match('em', tokens.emValue, 1);\n }\n function match(type, pattern, captureIndex) {\n var captures = scan(pattern);\n if (captures) {\n return {\n type: type,\n value: captures[captureIndex],\n };\n }\n }\n function scan(regexp) {\n var blankCaptures = /^[\\n\\r\\t\\s]+/.exec(input);\n if (blankCaptures) {\n consume(blankCaptures[0].length);\n }\n var captures = regexp.exec(input);\n if (captures) {\n consume(captures[0].length);\n }\n return captures;\n }\n function consume(size) {\n input = input.substring(size);\n }\n return function (code) {\n input = code;\n return getAST();\n };\n})();\nfunction computeLinearGradient(width, height, angle) {\n var rad = deg2rad(angle.value);\n var rx = 0;\n var ry = 0;\n var rcx = rx + width / 2;\n var rcy = ry + height / 2;\n // get the length of gradient line\n // @see https://observablehq.com/@danburzo/css-gradient-line\n var length = Math.abs(width * Math.cos(rad)) + Math.abs(height * Math.sin(rad));\n var x1 = rcx - (Math.cos(rad) * length) / 2;\n var y1 = rcy - (Math.sin(rad) * length) / 2;\n var x2 = rcx + (Math.cos(rad) * length) / 2;\n var y2 = rcy + (Math.sin(rad) * length) / 2;\n return { x1: x1, y1: y1, x2: x2, y2: y2 };\n}\nfunction computeRadialGradient(width, height, cx, cy, size) {\n // 'px'\n var x = cx.value;\n var y = cy.value;\n // TODO: 'em'\n // '%'\n if (cx.unit === UnitType.kPercentage) {\n x = (cx.value / 100) * width;\n }\n if (cy.unit === UnitType.kPercentage) {\n y = (cy.value / 100) * height;\n }\n // default to farthest-side\n var r = Math.max(distanceSquareRoot([0, 0], [x, y]), distanceSquareRoot([0, height], [x, y]), distanceSquareRoot([width, height], [x, y]), distanceSquareRoot([width, 0], [x, y]));\n if (size) {\n if (size instanceof CSSUnitValue) {\n r = size.value;\n }\n else if (size instanceof CSSKeywordValue) {\n // @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/CSS_Images/Using_CSS_gradients#example_closest-side_for_circles\n if (size.value === 'closest-side') {\n r = Math.min(x, width - x, y, height - y);\n }\n else if (size.value === 'farthest-side') {\n r = Math.max(x, width - x, y, height - y);\n }\n else if (size.value === 'closest-corner') {\n r = Math.min(distanceSquareRoot([0, 0], [x, y]), distanceSquareRoot([0, height], [x, y]), distanceSquareRoot([width, height], [x, y]), distanceSquareRoot([width, 0], [x, y]));\n }\n }\n }\n return { x: x, y: y, r: r };\n}\n\nvar regexLG = /^l\\s*\\(\\s*([\\d.]+)\\s*\\)\\s*(.*)/i;\nvar regexRG = /^r\\s*\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*\\)\\s*(.*)/i;\nvar regexPR = /^p\\s*\\(\\s*([axyn])\\s*\\)\\s*(.*)/i;\nvar regexColorStop = /[\\d.]+:(#[^\\s]+|[^\\)]+\\))/gi;\nfunction spaceColorStops(colorStops) {\n var _a, _b, _c;\n var length = colorStops.length;\n colorStops[length - 1].length = (_a = colorStops[length - 1].length) !== null && _a !== void 0 ? _a : {\n type: '%',\n value: '100',\n };\n if (length > 1) {\n colorStops[0].length = (_b = colorStops[0].length) !== null && _b !== void 0 ? _b : {\n type: '%',\n value: '0',\n };\n }\n var previousIndex = 0;\n var previousOffset = Number(colorStops[0].length.value);\n for (var i = 1; i < length; i++) {\n // support '%' & 'px'\n var offset = (_c = colorStops[i].length) === null || _c === void 0 ? void 0 : _c.value;\n if (!isNil(offset) && !isNil(previousOffset)) {\n for (var j = 1; j < i - previousIndex; j++)\n colorStops[previousIndex + j].length = {\n type: '%',\n value: \"\".concat(previousOffset +\n ((Number(offset) - previousOffset) * j) / (i - previousIndex)),\n };\n previousIndex = i;\n previousOffset = Number(offset);\n }\n }\n}\n// The position of the gradient line's starting point.\n// different from CSS side(to top) @see https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient#values\nvar SideOrCornerToDegMap = {\n left: 270 - 90,\n top: 0 - 90,\n bottom: 180 - 90,\n right: 90 - 90,\n 'left top': 315 - 90,\n 'top left': 315 - 90,\n 'left bottom': 225 - 90,\n 'bottom left': 225 - 90,\n 'right top': 45 - 90,\n 'top right': 45 - 90,\n 'right bottom': 135 - 90,\n 'bottom right': 135 - 90,\n};\nvar angleToDeg = memoize(function (orientation) {\n var angle;\n if (orientation.type === 'angular') {\n angle = Number(orientation.value);\n }\n else {\n angle = SideOrCornerToDegMap[orientation.value] || 0;\n }\n return getOrCreateUnitValue(angle, 'deg');\n});\nvar positonToCSSUnitValue = memoize(function (position) {\n var cx = 50;\n var cy = 50;\n var unitX = '%';\n var unitY = '%';\n if ((position === null || position === void 0 ? void 0 : position.type) === 'position') {\n var _a = position.value, x = _a.x, y = _a.y;\n if ((x === null || x === void 0 ? void 0 : x.type) === 'position-keyword') {\n if (x.value === 'left') {\n cx = 0;\n }\n else if (x.value === 'center') {\n cx = 50;\n }\n else if (x.value === 'right') {\n cx = 100;\n }\n else if (x.value === 'top') {\n cy = 0;\n }\n else if (x.value === 'bottom') {\n cy = 100;\n }\n }\n if ((y === null || y === void 0 ? void 0 : y.type) === 'position-keyword') {\n if (y.value === 'left') {\n cx = 0;\n }\n else if (y.value === 'center') {\n cy = 50;\n }\n else if (y.value === 'right') {\n cx = 100;\n }\n else if (y.value === 'top') {\n cy = 0;\n }\n else if (y.value === 'bottom') {\n cy = 100;\n }\n }\n if ((x === null || x === void 0 ? void 0 : x.type) === 'px' || (x === null || x === void 0 ? void 0 : x.type) === '%' || (x === null || x === void 0 ? void 0 : x.type) === 'em') {\n unitX = x === null || x === void 0 ? void 0 : x.type;\n cx = Number(x.value);\n }\n if ((y === null || y === void 0 ? void 0 : y.type) === 'px' || (y === null || y === void 0 ? void 0 : y.type) === '%' || (y === null || y === void 0 ? void 0 : y.type) === 'em') {\n unitY = y === null || y === void 0 ? void 0 : y.type;\n cy = Number(y.value);\n }\n }\n return {\n cx: getOrCreateUnitValue(cx, unitX),\n cy: getOrCreateUnitValue(cy, unitY),\n };\n});\nvar parseGradient = memoize(function (colorStr) {\n var _a;\n if (colorStr.indexOf('linear') > -1 || colorStr.indexOf('radial') > -1) {\n var ast = parseGradient$1(colorStr);\n return ast.map(function (_a) {\n var type = _a.type, orientation = _a.orientation, colorStops = _a.colorStops;\n spaceColorStops(colorStops);\n var steps = colorStops.map(function (colorStop) {\n // TODO: only support % for now, should calc percentage of axis length when using px/em\n return {\n offset: getOrCreateUnitValue(Number(colorStop.length.value), '%'),\n color: colorStopToString(colorStop),\n };\n });\n if (type === 'linear-gradient') {\n return new CSSGradientValue(GradientType.LinearGradient, {\n angle: orientation\n ? angleToDeg(orientation)\n : Odeg,\n steps: steps,\n });\n }\n else if (type === 'radial-gradient') {\n if (!orientation) {\n orientation = [\n {\n type: 'shape',\n value: 'circle',\n },\n ];\n }\n if (orientation[0].type === 'shape' &&\n orientation[0].value === 'circle') {\n var _b = positonToCSSUnitValue(orientation[0].at), cx = _b.cx, cy = _b.cy;\n var size = void 0;\n if (orientation[0].style) {\n var _c = orientation[0].style, type_1 = _c.type, value = _c.value;\n if (type_1 === 'extent-keyword') {\n size = getOrCreateKeyword(value);\n }\n else {\n size = getOrCreateUnitValue(value, type_1);\n }\n }\n return new CSSGradientValue(GradientType.RadialGradient, {\n cx: cx,\n cy: cy,\n size: size,\n steps: steps,\n });\n }\n // TODO: support ellipse shape\n // TODO: repeating-linear-gradient & repeating-radial-gradient\n // } else if (type === 'repeating-linear-gradient') {\n // } else if (type === 'repeating-radial-gradient') {\n }\n });\n }\n // legacy format, should be deprecated later\n var type = colorStr[0];\n if (colorStr[1] === '(' || colorStr[2] === '(') {\n if (type === 'l') {\n var arr = regexLG.exec(colorStr);\n if (arr) {\n var steps = ((_a = arr[2].match(regexColorStop)) === null || _a === void 0 ? void 0 : _a.map(function (stop) { return stop.split(':'); })) || [];\n return [\n new CSSGradientValue(GradientType.LinearGradient, {\n angle: getOrCreateUnitValue(parseFloat(arr[1]), 'deg'),\n steps: steps.map(function (_a) {\n var _b = __read(_a, 2), offset = _b[0], color = _b[1];\n return ({\n offset: getOrCreateUnitValue(Number(offset) * 100, '%'),\n color: color,\n });\n }),\n }),\n ];\n }\n }\n else if (type === 'r') {\n var parsedRadialGradient = parseRadialGradient(colorStr);\n if (parsedRadialGradient) {\n if (isString(parsedRadialGradient)) {\n colorStr = parsedRadialGradient;\n }\n else {\n return [\n new CSSGradientValue(GradientType.RadialGradient, parsedRadialGradient),\n ];\n }\n }\n }\n else if (type === 'p') {\n return parsePattern(colorStr);\n }\n }\n});\nfunction parseRadialGradient(gradientStr) {\n var _a;\n var arr = regexRG.exec(gradientStr);\n if (arr) {\n var steps = ((_a = arr[4].match(regexColorStop)) === null || _a === void 0 ? void 0 : _a.map(function (stop) { return stop.split(':'); })) || [];\n return {\n cx: getOrCreateUnitValue(50, '%'),\n cy: getOrCreateUnitValue(50, '%'),\n steps: steps.map(function (_a) {\n var _b = __read(_a, 2), offset = _b[0], color = _b[1];\n return ({\n offset: getOrCreateUnitValue(Number(offset) * 100, '%'),\n color: color,\n });\n }),\n };\n }\n return null;\n}\nfunction parsePattern(patternStr) {\n var arr = regexPR.exec(patternStr);\n if (arr) {\n var repetition = arr[1];\n var src = arr[2];\n switch (repetition) {\n case 'a':\n repetition = 'repeat';\n break;\n case 'x':\n repetition = 'repeat-x';\n break;\n case 'y':\n repetition = 'repeat-y';\n break;\n case 'n':\n repetition = 'no-repeat';\n break;\n default:\n repetition = 'no-repeat';\n }\n return {\n image: src,\n // @ts-ignore\n repetition: repetition,\n };\n }\n return null;\n}\n\nfunction isCSSGradientValue(object) {\n return (!!object.type && !!object.value);\n}\nfunction isPattern(object) {\n return object && !!object.image;\n}\nfunction isCSSRGB(object) {\n return (object &&\n !isNil(object.r) &&\n !isNil(object.g) &&\n !isNil(object.b));\n}\n/**\n * @see https://github.com/WebKit/WebKit/blob/main/Source/WebCore/css/parser/CSSParser.cpp#L97\n */\nvar parseColor = memoize(function (colorStr) {\n if (isPattern(colorStr)) {\n return __assign({ repetition: 'repeat' }, colorStr);\n }\n if (isNil(colorStr)) {\n colorStr = '';\n }\n if (colorStr === 'transparent') {\n // transparent black\n return transparentColor;\n }\n else if (colorStr === 'currentColor') {\n // @see https://github.com/adobe-webplatform/Snap.svg/issues/526\n colorStr = 'black';\n }\n // support CSS gradient syntax\n var g = parseGradient(colorStr);\n if (g) {\n return g;\n }\n // constants\n var color = d3.color(colorStr);\n var rgba = [0, 0, 0, 0];\n if (color !== null) {\n rgba[0] = color.r || 0;\n rgba[1] = color.g || 0;\n rgba[2] = color.b || 0;\n rgba[3] = color.opacity;\n }\n // return new CSSRGB(...rgba);\n return getOrCreateRGBA.apply(void 0, __spreadArray([], __read(rgba), false));\n});\nfunction mergeColors(left, right) {\n // only support constant value, exclude gradient & pattern\n if (!isCSSRGB(left) || !isCSSRGB(right)) {\n return;\n }\n return [\n [Number(left.r), Number(left.g), Number(left.b), Number(left.alpha)],\n [Number(right.r), Number(right.g), Number(right.b), Number(right.alpha)],\n function (color) {\n var rgba = color.slice();\n if (rgba[3]) {\n for (var i = 0; i < 3; i++)\n rgba[i] = Math.round(clamp(rgba[i], 0, 255));\n }\n rgba[3] = clamp(rgba[3], 0, 1);\n return \"rgba(\".concat(rgba.join(','), \")\");\n },\n ];\n}\n\nfunction parseDimension(unitRegExp, string) {\n if (isNil(string)) {\n return getOrCreateUnitValue(0, 'px');\n }\n string = \"\".concat(string).trim().toLowerCase();\n if (isFinite(Number(string))) {\n if ('px'.search(unitRegExp) >= 0) {\n return getOrCreateUnitValue(Number(string), 'px');\n }\n else if ('deg'.search(unitRegExp) >= 0) {\n return getOrCreateUnitValue(Number(string), 'deg');\n }\n }\n var matchedUnits = [];\n string = string.replace(unitRegExp, function (match) {\n matchedUnits.push(match);\n return 'U' + match;\n });\n var taggedUnitRegExp = 'U(' + unitRegExp.source + ')';\n return matchedUnits.map(function (unit) {\n return getOrCreateUnitValue(Number(string\n .replace(new RegExp('U' + unit, 'g'), '')\n .replace(new RegExp(taggedUnitRegExp, 'g'), '*0')), unit);\n })[0];\n}\n/**\n * \n * @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/length\n * length with only absolute unit, eg. 1px\n */\nvar parseLengthUnmemoize = function (css) {\n return parseDimension(new RegExp('px', 'g'), css);\n};\nvar parseLength = memoize(parseLengthUnmemoize);\n/**\n * \n * @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/percentage\n */\nvar parserPercentageUnmemoize = function (css) {\n return parseDimension(new RegExp('%', 'g'), css);\n};\nmemoize(parserPercentageUnmemoize);\n/**\n * length with absolute or relative unit,\n * eg. 1px, 0.7em, 50%, calc(100% - 200px);\n *\n * @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/length-percentage\n */\nvar parseLengthOrPercentageUnmemoize = function (css) {\n if (isNumber(css) || isFinite(Number(css))) {\n // Number(css) is NaN\n return getOrCreateUnitValue(Number(css) || 0, 'px');\n // return Number(css);\n }\n return parseDimension(new RegExp('px|%|em|rem', 'g'), css);\n};\nvar parseLengthOrPercentage = memoize(parseLengthOrPercentageUnmemoize);\nvar parseAngleUnmemoize = function (css) {\n return parseDimension(new RegExp('deg|rad|grad|turn', 'g'), css);\n};\nvar parseAngle = memoize(parseAngleUnmemoize);\n/**\n * merge CSSUnitValue\n *\n * @example\n * 10px + 20px = 30px\n * 10deg + 10rad\n * 10% + 20% = 30%\n */\nfunction mergeDimensions(left, right, target, nonNegative, index) {\n if (index === void 0) { index = 0; }\n var unit = '';\n var leftValue = left.value || 0;\n var rightValue = right.value || 0;\n var canonicalUnit = toCanonicalUnit(left.unit);\n var leftCanonicalUnitValue = left.convertTo(canonicalUnit);\n var rightCanonicalUnitValue = right.convertTo(canonicalUnit);\n if (leftCanonicalUnitValue && rightCanonicalUnitValue) {\n leftValue = leftCanonicalUnitValue.value;\n rightValue = rightCanonicalUnitValue.value;\n unit = unitTypeToString(left.unit);\n }\n else {\n // format '%' to 'px'\n if (CSSUnitValue.isLength(left.unit) || CSSUnitValue.isLength(right.unit)) {\n leftValue = convertPercentUnit(left, index, target);\n rightValue = convertPercentUnit(right, index, target);\n unit = 'px';\n }\n }\n // // format 'rad' 'turn' to 'deg'\n // if (CSSUnitValue.isAngle(left.unit) || CSSUnitValue.isAngle(right.unit)) {\n // leftValue = convertAngleUnit(left);\n // rightValue = convertAngleUnit(right);\n // unit = 'deg';\n // }\n return [\n leftValue,\n rightValue,\n function (value) {\n if (nonNegative) {\n value = Math.max(value, 0);\n }\n return value + unit;\n },\n ];\n}\nfunction convertAngleUnit(value) {\n var deg = 0;\n if (value.unit === UnitType.kDegrees) {\n deg = value.value;\n }\n else if (value.unit === UnitType.kRadians) {\n deg = rad2deg(Number(value.value));\n }\n else if (value.unit === UnitType.kTurns) {\n deg = turn2deg(Number(value.value));\n }\n return deg;\n}\nfunction parseDimensionArrayFormat(string, size) {\n var parsed;\n if (Array.isArray(string)) {\n // [1, '2px', 3]\n parsed = string.map(function (segment) { return Number(segment); });\n }\n else if (isString(string)) {\n parsed = string.split(' ').map(function (segment) { return Number(segment); });\n }\n else if (isNumber(string)) {\n parsed = [string];\n }\n if (size === 2) {\n if (parsed.length === 1) {\n return [parsed[0], parsed[0]];\n }\n else {\n return [parsed[0], parsed[1]];\n }\n }\n else {\n if (parsed.length === 1) {\n return [parsed[0], parsed[0], parsed[0], parsed[0]];\n }\n else if (parsed.length === 2) {\n return [parsed[0], parsed[1], parsed[0], parsed[1]];\n }\n else if (parsed.length === 3) {\n return [parsed[0], parsed[1], parsed[2], parsed[1]];\n }\n else {\n return [parsed[0], parsed[1], parsed[2], parsed[3]];\n }\n }\n}\nfunction parseDimensionArray(string) {\n if (isString(string)) {\n // \"1px 2px 3px\"\n return string.split(' ').map(function (segment) { return parseLengthOrPercentage(segment); });\n }\n else {\n // [1, '2px', 3]\n return string.map(function (segment) { return parseLengthOrPercentage(segment.toString()); });\n }\n}\n// export function mergeDimensionList(\n// left: CSSUnitValue[],\n// right: CSSUnitValue[],\n// target: IElement | null,\n// ): [number[], number[], (list: number[]) => string] | undefined {\n// if (left.length !== right.length) {\n// return;\n// }\n// const unit = left[0].unit;\n// return [\n// left.map((l) => l.value),\n// right.map((l) => l.value),\n// (values: number[]) => {\n// return values.map((n) => new CSSUnitValue(n, unit)).join(' ');\n// },\n// ];\n// }\nfunction convertPercentUnit(valueWithUnit, vec3Index, target) {\n if (valueWithUnit.value === 0) {\n return 0;\n }\n if (valueWithUnit.unit === UnitType.kPixels) {\n return Number(valueWithUnit.value);\n }\n else if (valueWithUnit.unit === UnitType.kPercentage && target) {\n var bounds = target.nodeName === Shape.GROUP\n ? target.getLocalBounds()\n : // : target.getGeometryBounds();\n target.geometry.contentBounds;\n return (valueWithUnit.value / 100) * bounds.halfExtents[vec3Index] * 2;\n }\n return 0;\n}\n\nvar parseParam = function (css) {\n return parseDimension(/deg|rad|grad|turn|px|%/g, css);\n};\nvar supportedFilters = [\n 'blur',\n 'brightness',\n 'drop-shadow',\n 'contrast',\n 'grayscale',\n 'sepia',\n 'saturate',\n 'hue-rotate',\n 'invert',\n];\nfunction parseFilter(filterStr) {\n if (filterStr === void 0) { filterStr = ''; }\n filterStr = filterStr.toLowerCase().trim();\n if (filterStr === 'none') {\n return [];\n }\n var filterRegExp = /\\s*([\\w-]+)\\(([^)]*)\\)/g;\n var result = [];\n var match;\n var prevLastIndex = 0;\n while ((match = filterRegExp.exec(filterStr))) {\n if (match.index !== prevLastIndex) {\n return [];\n }\n prevLastIndex = match.index + match[0].length;\n if (supportedFilters.indexOf(match[1]) > -1) {\n result.push({\n name: match[1],\n params: match[2].split(' ').map(function (p) { return parseParam(p) || parseColor(p); }),\n });\n }\n if (filterRegExp.lastIndex === filterStr.length) {\n return result;\n }\n }\n return [];\n}\n\nfunction numberToString(x) {\n // scale(0.00000001) -> scale(0)\n // return x.toFixed(6).replace(/0+$/, '').replace(/\\.$/, '');\n return x.toString();\n}\n/**\n * parse string or number to CSSUnitValue(numeric)\n *\n * eg.\n * * 0 -> CSSUnitValue(0)\n * * '2' -> CSSUnitValue(2)\n */\nvar parseNumberUnmemoize = function (string) {\n if (typeof string === 'number') {\n return getOrCreateUnitValue(string);\n }\n if (/^\\s*[-+]?(\\d*\\.)?\\d+\\s*$/.test(string)) {\n return getOrCreateUnitValue(Number(string));\n }\n else {\n return getOrCreateUnitValue(0);\n }\n};\nvar parseNumber = memoize(parseNumberUnmemoize);\nmemoize(function (string) {\n if (isString(string)) {\n return string.split(' ').map(parseNumber);\n }\n else {\n return string.map(parseNumber);\n }\n});\nfunction mergeNumbers(left, right) {\n return [left, right, numberToString];\n}\nfunction clampedMergeNumbers(min, max) {\n return function (left, right) { return [\n left,\n right,\n function (x) { return numberToString(clamp(x, min, max)); },\n ]; };\n}\nfunction mergeNumberLists(left, right) {\n if (left.length !== right.length) {\n return;\n }\n return [\n left,\n right,\n function (numberList) {\n return numberList;\n },\n ];\n}\n\nfunction getOrCalculatePathTotalLength(path) {\n if (path.parsedStyle.path.totalLength === 0) {\n path.parsedStyle.path.totalLength = getTotalLength(path.parsedStyle.path.absolutePath);\n }\n return path.parsedStyle.path.totalLength;\n}\nfunction removeRedundantMCommand(path) {\n for (var i = 0; i < path.length; i++) {\n var prevSegment = path[i - 1];\n var segment = path[i];\n var cmd = segment[0];\n if (cmd === 'M') {\n if (prevSegment) {\n var prevCmd = prevSegment[0];\n var srcPoint = [segment[1], segment[2]];\n var destPoint = void 0;\n if (prevCmd === 'L' || prevCmd === 'M') {\n destPoint = [prevSegment[1], prevSegment[2]];\n }\n else if (prevCmd === 'C' || prevCmd === 'A' || prevCmd === 'Q') {\n destPoint = [\n prevSegment[prevSegment.length - 2],\n prevSegment[prevSegment.length - 1],\n ];\n }\n if (destPoint && isSamePoint(srcPoint, destPoint)) {\n path.splice(i, 1);\n i--;\n }\n }\n }\n }\n}\nfunction hasArcOrBezier(path) {\n var hasArc = false;\n var count = path.length;\n for (var i = 0; i < count; i++) {\n var params = path[i];\n var cmd = params[0];\n if (cmd === 'C' || cmd === 'A' || cmd === 'Q') {\n hasArc = true;\n break;\n }\n }\n return hasArc;\n}\nfunction extractPolygons(pathArray) {\n var polygons = [];\n var polylines = [];\n var points = []; // 防止第一个命令不是 'M'\n for (var i = 0; i < pathArray.length; i++) {\n var params = pathArray[i];\n var cmd = params[0];\n if (cmd === 'M') {\n // 遇到 'M' 判定是否是新数组,新数组中没有点\n if (points.length) {\n // 如果存在点,则说明没有遇到 'Z',开始了一个新的多边形\n polylines.push(points);\n points = []; // 创建新的点\n }\n points.push([params[1], params[2]]);\n }\n else if (cmd === 'Z') {\n if (points.length) {\n // 存在点\n polygons.push(points);\n points = []; // 开始新的点集合\n }\n // 如果不存在点,同时 'Z',则说明是错误,不处理\n }\n else {\n points.push([params[1], params[2]]);\n }\n }\n // 说明 points 未放入 polygons 或者 polyline\n // 仅当只有一个 M,没有 Z 时会发生这种情况\n if (points.length > 0) {\n polylines.push(points);\n }\n return {\n polygons: polygons,\n polylines: polylines,\n };\n}\nfunction isSamePoint(point1, point2) {\n return point1[0] === point2[0] && point1[1] === point2[1];\n}\nfunction getPathBBox(segments, lineWidth) {\n var xArr = [];\n var yArr = [];\n var segmentsWithAngle = [];\n for (var i = 0; i < segments.length; i++) {\n var segment = segments[i];\n var currentPoint = segment.currentPoint, params = segment.params, prePoint = segment.prePoint;\n var box = void 0;\n switch (segment.command) {\n case 'Q':\n box = quadBox(prePoint[0], prePoint[1], params[1], params[2], params[3], params[4]);\n break;\n case 'C':\n box = cubicBox(prePoint[0], prePoint[1], params[1], params[2], params[3], params[4], params[5], params[6]);\n break;\n case 'A':\n var arcParams = segment.arcParams;\n box = arcBox(arcParams.cx, arcParams.cy, arcParams.rx, arcParams.ry, arcParams.xRotation, arcParams.startAngle, arcParams.endAngle);\n break;\n default:\n xArr.push(currentPoint[0]);\n yArr.push(currentPoint[1]);\n break;\n }\n if (box) {\n segment.box = box;\n xArr.push(box.x, box.x + box.width);\n yArr.push(box.y, box.y + box.height);\n }\n if (lineWidth &&\n (segment.command === 'L' || segment.command === 'M') &&\n segment.prePoint &&\n segment.nextPoint) {\n segmentsWithAngle.push(segment);\n }\n }\n // bbox calculation should ignore NaN for path attribute\n // ref: https://github.com/antvis/g/issues/210\n // ref: https://github.com/antvis/G2/issues/3109\n xArr = xArr.filter(function (item) { return !Number.isNaN(item) && item !== Infinity && item !== -Infinity; });\n yArr = yArr.filter(function (item) { return !Number.isNaN(item) && item !== Infinity && item !== -Infinity; });\n var minX = min(xArr);\n var minY = min(yArr);\n var maxX = max(xArr);\n var maxY = max(yArr);\n if (segmentsWithAngle.length === 0) {\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n }\n for (var i = 0; i < segmentsWithAngle.length; i++) {\n var segment = segmentsWithAngle[i];\n var currentPoint = segment.currentPoint;\n var extra = void 0;\n if (currentPoint[0] === minX) {\n extra = getExtraFromSegmentWithAngle(segment, lineWidth);\n minX = minX - extra.xExtra;\n }\n else if (currentPoint[0] === maxX) {\n extra = getExtraFromSegmentWithAngle(segment, lineWidth);\n maxX = maxX + extra.xExtra;\n }\n if (currentPoint[1] === minY) {\n extra = getExtraFromSegmentWithAngle(segment, lineWidth);\n minY = minY - extra.yExtra;\n }\n else if (currentPoint[1] === maxY) {\n extra = getExtraFromSegmentWithAngle(segment, lineWidth);\n maxY = maxY + extra.yExtra;\n }\n }\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n}\nfunction getExtraFromSegmentWithAngle(segment, lineWidth) {\n var prePoint = segment.prePoint, currentPoint = segment.currentPoint, nextPoint = segment.nextPoint;\n var currentAndPre = Math.pow(currentPoint[0] - prePoint[0], 2) +\n Math.pow(currentPoint[1] - prePoint[1], 2);\n var currentAndNext = Math.pow(currentPoint[0] - nextPoint[0], 2) +\n Math.pow(currentPoint[1] - nextPoint[1], 2);\n var preAndNext = Math.pow(prePoint[0] - nextPoint[0], 2) +\n Math.pow(prePoint[1] - nextPoint[1], 2);\n // 以 currentPoint 为顶点的夹角\n var currentAngle = Math.acos((currentAndPre + currentAndNext - preAndNext) /\n (2 * Math.sqrt(currentAndPre) * Math.sqrt(currentAndNext)));\n // 夹角为空、 0 或 PI 时,不需要计算夹角处的额外宽度\n // 注意: 由于计算精度问题,夹角为 0 的情况计算出来的角度可能是一个很小的值,还需要判断其与 0 是否近似相等\n if (!currentAngle ||\n Math.sin(currentAngle) === 0 ||\n isNumberEqual(currentAngle, 0)) {\n return {\n xExtra: 0,\n yExtra: 0,\n };\n }\n var xAngle = Math.abs(Math.atan2(nextPoint[1] - currentPoint[1], nextPoint[0] - currentPoint[0]));\n var yAngle = Math.abs(Math.atan2(nextPoint[0] - currentPoint[0], nextPoint[1] - currentPoint[1]));\n // 将夹角转为锐角\n xAngle = xAngle > Math.PI / 2 ? Math.PI - xAngle : xAngle;\n yAngle = yAngle > Math.PI / 2 ? Math.PI - yAngle : yAngle;\n // 这里不考虑在水平和垂直方向的投影,直接使用最大差值\n // 由于上层统一加减了二分之一线宽,这里需要进行弥补\n var extra = {\n // 水平方向投影\n xExtra: Math.cos(currentAngle / 2 - xAngle) *\n ((lineWidth / 2) * (1 / Math.sin(currentAngle / 2))) -\n lineWidth / 2 || 0,\n // 垂直方向投影\n yExtra: Math.cos(yAngle - currentAngle / 2) *\n ((lineWidth / 2) * (1 / Math.sin(currentAngle / 2))) -\n lineWidth / 2 || 0,\n };\n return extra;\n}\n// 点对称\nfunction toSymmetry(point, center) {\n return [\n center[0] + (center[0] - point[0]),\n center[1] + (center[1] - point[1]),\n ];\n}\nvar angleBetween = function (v0, v1) {\n var p = v0.x * v1.x + v0.y * v1.y;\n var n = Math.sqrt((Math.pow(v0.x, 2) + Math.pow(v0.y, 2)) *\n (Math.pow(v1.x, 2) + Math.pow(v1.y, 2)));\n var sign = v0.x * v1.y - v0.y * v1.x < 0 ? -1 : 1;\n var angle = sign * Math.acos(p / n);\n return angle;\n};\n/**\n * @see https://github.com/rveciana/svg-path-properties/blob/b6bd9a322966f6ef7a311872d80c56e3718de861/src/arc.ts#L121\n */\nvar pointOnEllipticalArc = function (p0, rx, ry, xAxisRotation, largeArcFlag, sweepFlag, p1, t) {\n // In accordance to: http://www.w3.org/TR/SVG/implnote.html#ArcOutOfRangeParameters\n rx = Math.abs(rx);\n ry = Math.abs(ry);\n xAxisRotation = mod(xAxisRotation, 360);\n var xAxisRotationRadians = deg2rad(xAxisRotation);\n // If the endpoints are identical, then this is equivalent to omitting the elliptical arc segment entirely.\n if (p0.x === p1.x && p0.y === p1.y) {\n return { x: p0.x, y: p0.y, ellipticalArcAngle: 0 }; // Check if angle is correct\n }\n // If rx = 0 or ry = 0 then this arc is treated as a straight line segment joining the endpoints.\n if (rx === 0 || ry === 0) {\n //return this.pointOnLine(p0, p1, t);\n return { x: 0, y: 0, ellipticalArcAngle: 0 }; // Check if angle is correct\n }\n // Following \"Conversion from endpoint to center parameterization\"\n // http://www.w3.org/TR/SVG/implnote.html#ArcConversionEndpointToCenter\n // Step #1: Compute transformedPoint\n var dx = (p0.x - p1.x) / 2;\n var dy = (p0.y - p1.y) / 2;\n var transformedPoint = {\n x: Math.cos(xAxisRotationRadians) * dx + Math.sin(xAxisRotationRadians) * dy,\n y: -Math.sin(xAxisRotationRadians) * dx +\n Math.cos(xAxisRotationRadians) * dy,\n };\n // Ensure radii are large enough\n var radiiCheck = Math.pow(transformedPoint.x, 2) / Math.pow(rx, 2) +\n Math.pow(transformedPoint.y, 2) / Math.pow(ry, 2);\n if (radiiCheck > 1) {\n rx = Math.sqrt(radiiCheck) * rx;\n ry = Math.sqrt(radiiCheck) * ry;\n }\n // Step #2: Compute transformedCenter\n var cSquareNumerator = Math.pow(rx, 2) * Math.pow(ry, 2) -\n Math.pow(rx, 2) * Math.pow(transformedPoint.y, 2) -\n Math.pow(ry, 2) * Math.pow(transformedPoint.x, 2);\n var cSquareRootDenom = Math.pow(rx, 2) * Math.pow(transformedPoint.y, 2) +\n Math.pow(ry, 2) * Math.pow(transformedPoint.x, 2);\n var cRadicand = cSquareNumerator / cSquareRootDenom;\n // Make sure this never drops below zero because of precision\n cRadicand = cRadicand < 0 ? 0 : cRadicand;\n var cCoef = (largeArcFlag !== sweepFlag ? 1 : -1) * Math.sqrt(cRadicand);\n var transformedCenter = {\n x: cCoef * ((rx * transformedPoint.y) / ry),\n y: cCoef * (-(ry * transformedPoint.x) / rx),\n };\n // Step #3: Compute center\n var center = {\n x: Math.cos(xAxisRotationRadians) * transformedCenter.x -\n Math.sin(xAxisRotationRadians) * transformedCenter.y +\n (p0.x + p1.x) / 2,\n y: Math.sin(xAxisRotationRadians) * transformedCenter.x +\n Math.cos(xAxisRotationRadians) * transformedCenter.y +\n (p0.y + p1.y) / 2,\n };\n // Step #4: Compute start/sweep angles\n // Start angle of the elliptical arc prior to the stretch and rotate operations.\n // Difference between the start and end angles\n var startVector = {\n x: (transformedPoint.x - transformedCenter.x) / rx,\n y: (transformedPoint.y - transformedCenter.y) / ry,\n };\n var startAngle = angleBetween({\n x: 1,\n y: 0,\n }, startVector);\n var endVector = {\n x: (-transformedPoint.x - transformedCenter.x) / rx,\n y: (-transformedPoint.y - transformedCenter.y) / ry,\n };\n var sweepAngle = angleBetween(startVector, endVector);\n if (!sweepFlag && sweepAngle > 0) {\n sweepAngle -= 2 * Math.PI;\n }\n else if (sweepFlag && sweepAngle < 0) {\n sweepAngle += 2 * Math.PI;\n }\n // We use % instead of `mod(..)` because we want it to be -360deg to 360deg(but actually in radians)\n sweepAngle %= 2 * Math.PI;\n // From http://www.w3.org/TR/SVG/implnote.html#ArcParameterizationAlternatives\n var angle = startAngle + sweepAngle * t;\n var ellipseComponentX = rx * Math.cos(angle);\n var ellipseComponentY = ry * Math.sin(angle);\n var point = {\n x: Math.cos(xAxisRotationRadians) * ellipseComponentX -\n Math.sin(xAxisRotationRadians) * ellipseComponentY +\n center.x,\n y: Math.sin(xAxisRotationRadians) * ellipseComponentX +\n Math.cos(xAxisRotationRadians) * ellipseComponentY +\n center.y,\n ellipticalArcStartAngle: startAngle,\n ellipticalArcEndAngle: startAngle + sweepAngle,\n ellipticalArcAngle: angle,\n ellipticalArcCenter: center,\n resultantRx: rx,\n resultantRy: ry,\n };\n return point;\n};\nfunction path2Segments(path) {\n var segments = [];\n var currentPoint = null; // 当前图形\n var nextParams = null; // 下一节点的 path 参数\n var startMovePoint = null; // 开始 M 的点,可能会有多个\n var lastStartMovePointIndex = 0; // 最近一个开始点 M 的索引\n var count = path.length;\n for (var i = 0; i < count; i++) {\n var params = path[i];\n nextParams = path[i + 1];\n var command = params[0];\n // 数学定义上的参数,便于后面的计算\n var segment = {\n command: command,\n prePoint: currentPoint,\n params: params,\n startTangent: null,\n endTangent: null,\n currentPoint: null,\n nextPoint: null,\n arcParams: null,\n box: null,\n cubicParams: null,\n };\n switch (command) {\n case 'M':\n startMovePoint = [params[1], params[2]];\n lastStartMovePointIndex = i;\n break;\n case 'A':\n var arcParams = getArcParams(currentPoint, params);\n segment.arcParams = arcParams;\n break;\n }\n if (command === 'Z') {\n // 有了 Z 后,当前节点从开始 M 的点开始\n currentPoint = startMovePoint;\n // 如果当前点的命令为 Z,相当于当前点为最近一个 M 点,则下一个点直接指向最近一个 M 点的下一个点\n nextParams = path[lastStartMovePointIndex + 1];\n }\n else {\n var len = params.length;\n currentPoint = [params[len - 2], params[len - 1]];\n }\n if (nextParams && nextParams[0] === 'Z') {\n // 如果下一个点的命令为 Z,则下一个点直接指向最近一个 M 点\n nextParams = path[lastStartMovePointIndex];\n if (segments[lastStartMovePointIndex]) {\n // 如果下一个点的命令为 Z,则最近一个 M 点的前一个点为当前点\n segments[lastStartMovePointIndex].prePoint = currentPoint;\n }\n }\n segment.currentPoint = currentPoint;\n // 如果当前点与最近一个 M 点相同,则最近一个 M 点的前一个点为当前点的前一个点\n if (segments[lastStartMovePointIndex] &&\n isSamePoint(currentPoint, segments[lastStartMovePointIndex].currentPoint)) {\n segments[lastStartMovePointIndex].prePoint = segment.prePoint;\n }\n var nextPoint = nextParams\n ? [nextParams[nextParams.length - 2], nextParams[nextParams.length - 1]]\n : null;\n segment.nextPoint = nextPoint;\n // Add startTangent and endTangent\n var prePoint = segment.prePoint;\n if (['L', 'H', 'V'].includes(command)) {\n segment.startTangent = [\n prePoint[0] - currentPoint[0],\n prePoint[1] - currentPoint[1],\n ];\n segment.endTangent = [\n currentPoint[0] - prePoint[0],\n currentPoint[1] - prePoint[1],\n ];\n }\n else if (command === 'Q') {\n // 二次贝塞尔曲线只有一个控制点\n var cp = [params[1], params[2]];\n // 二次贝塞尔曲线的终点为 currentPoint\n segment.startTangent = [prePoint[0] - cp[0], prePoint[1] - cp[1]];\n segment.endTangent = [currentPoint[0] - cp[0], currentPoint[1] - cp[1]];\n }\n else if (command === 'T') {\n var preSegment = segments[i - 1];\n var cp = toSymmetry(preSegment.currentPoint, prePoint);\n if (preSegment.command === 'Q') {\n segment.command = 'Q';\n segment.startTangent = [prePoint[0] - cp[0], prePoint[1] - cp[1]];\n segment.endTangent = [currentPoint[0] - cp[0], currentPoint[1] - cp[1]];\n }\n else {\n // @ts-ignore\n segment.command = 'TL';\n segment.startTangent = [\n prePoint[0] - currentPoint[0],\n prePoint[1] - currentPoint[1],\n ];\n segment.endTangent = [\n currentPoint[0] - prePoint[0],\n currentPoint[1] - prePoint[1],\n ];\n }\n }\n else if (command === 'C') {\n // 三次贝塞尔曲线有两个控制点\n var cp1 = [params[1], params[2]];\n var cp2 = [params[3], params[4]];\n segment.startTangent = [prePoint[0] - cp1[0], prePoint[1] - cp1[1]];\n segment.endTangent = [currentPoint[0] - cp2[0], currentPoint[1] - cp2[1]];\n // horizontal line, eg. ['C', 100, 100, 100, 100, 200, 200]\n if (segment.startTangent[0] === 0 && segment.startTangent[1] === 0) {\n segment.startTangent = [cp1[0] - cp2[0], cp1[1] - cp2[1]];\n }\n if (segment.endTangent[0] === 0 && segment.endTangent[1] === 0) {\n segment.endTangent = [cp2[0] - cp1[0], cp2[1] - cp1[1]];\n }\n }\n else if (command === 'S') {\n var preSegment = segments[i - 1];\n var cp1 = toSymmetry(preSegment.currentPoint, prePoint);\n var cp2 = [params[1], params[2]];\n if (preSegment.command === 'C') {\n segment.command = 'C'; // 将 S 命令变换为 C 命令\n segment.startTangent = [prePoint[0] - cp1[0], prePoint[1] - cp1[1]];\n segment.endTangent = [\n currentPoint[0] - cp2[0],\n currentPoint[1] - cp2[1],\n ];\n }\n else {\n // @ts-ignore\n segment.command = 'SQ'; // 将 S 命令变换为 SQ 命令\n segment.startTangent = [prePoint[0] - cp2[0], prePoint[1] - cp2[1]];\n segment.endTangent = [\n currentPoint[0] - cp2[0],\n currentPoint[1] - cp2[1],\n ];\n }\n }\n else if (command === 'A') {\n var _a = getTangentAtRatio(segment, 0), dx1 = _a.x, dy1 = _a.y;\n var _b = getTangentAtRatio(segment, 1, false), dx2 = _b.x, dy2 = _b.y;\n segment.startTangent = [dx1, dy1];\n segment.endTangent = [dx2, dy2];\n }\n segments.push(segment);\n }\n return segments;\n}\n/**\n * Use length instead of ratio\n */\nfunction getTangentAtRatio(segment, ratio, sign) {\n if (sign === void 0) { sign = true; }\n var _a = segment.arcParams, _b = _a.rx, rx = _b === void 0 ? 0 : _b, _c = _a.ry, ry = _c === void 0 ? 0 : _c, xRotation = _a.xRotation, arcFlag = _a.arcFlag, sweepFlag = _a.sweepFlag;\n var p1 = pointOnEllipticalArc({ x: segment.prePoint[0], y: segment.prePoint[1] }, rx, ry, xRotation, !!arcFlag, !!sweepFlag, { x: segment.currentPoint[0], y: segment.currentPoint[1] }, ratio);\n var p2 = pointOnEllipticalArc({ x: segment.prePoint[0], y: segment.prePoint[1] }, rx, ry, xRotation, !!arcFlag, !!sweepFlag, { x: segment.currentPoint[0], y: segment.currentPoint[1] }, sign ? ratio + 0.005 : ratio - 0.005);\n var xDist = p2.x - p1.x;\n var yDist = p2.y - p1.y;\n var dist = Math.sqrt(xDist * xDist + yDist * yDist);\n return { x: -xDist / dist, y: -yDist / dist };\n}\n// 向量长度\nfunction vMag(v) {\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\n}\n// u.v/|u||v|,计算夹角的余弦值\nfunction vRatio(u, v) {\n // 当存在一个向量的长度为 0 时,夹角也为 0,即夹角的余弦值为 1\n return vMag(u) * vMag(v)\n ? (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v))\n : 1;\n}\n// 向量角度\nfunction vAngle(u, v) {\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v));\n}\nfunction getArcParams(startPoint, params) {\n var rx = params[1];\n var ry = params[2];\n var xRotation = mod(deg2rad(params[3]), Math.PI * 2);\n var arcFlag = params[4];\n var sweepFlag = params[5];\n // 弧形起点坐标\n var x1 = startPoint[0];\n var y1 = startPoint[1];\n // 弧形终点坐标\n var x2 = params[6];\n var y2 = params[7];\n var xp = (Math.cos(xRotation) * (x1 - x2)) / 2.0 +\n (Math.sin(xRotation) * (y1 - y2)) / 2.0;\n var yp = (-1 * Math.sin(xRotation) * (x1 - x2)) / 2.0 +\n (Math.cos(xRotation) * (y1 - y2)) / 2.0;\n var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\n if (lambda > 1) {\n rx *= Math.sqrt(lambda);\n ry *= Math.sqrt(lambda);\n }\n var diff = rx * rx * (yp * yp) + ry * ry * (xp * xp);\n var f = diff ? Math.sqrt((rx * rx * (ry * ry) - diff) / diff) : 1;\n if (arcFlag === sweepFlag) {\n f *= -1;\n }\n if (isNaN(f)) {\n f = 0;\n }\n // 旋转前的起点坐标,且当长半轴和短半轴的长度为 0 时,坐标按 (0, 0) 处理\n var cxp = ry ? (f * rx * yp) / ry : 0;\n var cyp = rx ? (f * -ry * xp) / rx : 0;\n // 椭圆圆心坐标\n var cx = (x1 + x2) / 2.0 + Math.cos(xRotation) * cxp - Math.sin(xRotation) * cyp;\n var cy = (y1 + y2) / 2.0 + Math.sin(xRotation) * cxp + Math.cos(xRotation) * cyp;\n // 起始点的单位向量\n var u = [(xp - cxp) / rx, (yp - cyp) / ry];\n // 终止点的单位向量\n var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\n // 计算起始点和圆心的连线,与 x 轴正方向的夹角\n var theta = vAngle([1, 0], u);\n // 计算圆弧起始点和终止点与椭圆圆心连线的夹角\n var dTheta = vAngle(u, v);\n if (vRatio(u, v) <= -1) {\n dTheta = Math.PI;\n }\n if (vRatio(u, v) >= 1) {\n dTheta = 0;\n }\n if (sweepFlag === 0 && dTheta > 0) {\n dTheta = dTheta - 2 * Math.PI;\n }\n if (sweepFlag === 1 && dTheta < 0) {\n dTheta = dTheta + 2 * Math.PI;\n }\n return {\n cx: cx,\n cy: cy,\n // 弧形的起点和终点相同时,长轴和短轴的长度按 0 处理\n rx: isSamePoint(startPoint, [x2, y2]) ? 0 : rx,\n ry: isSamePoint(startPoint, [x2, y2]) ? 0 : ry,\n startAngle: theta,\n endAngle: theta + dTheta,\n xRotation: xRotation,\n arcFlag: arcFlag,\n sweepFlag: sweepFlag,\n };\n}\nfunction commandsToPathString(commands, object, transform) {\n var _a = object.parsedStyle, _b = _a.defX, defX = _b === void 0 ? 0 : _b, _c = _a.defY, defY = _c === void 0 ? 0 : _c;\n return commands.reduce(function (prev, cur) {\n var path = '';\n if (cur[0] === 'M' || cur[0] === 'L') {\n var p = vec3.fromValues(cur[1] - defX, cur[2] - defY, 0);\n if (transform) {\n vec3.transformMat4(p, p, transform);\n }\n path = \"\".concat(cur[0]).concat(p[0], \",\").concat(p[1]);\n }\n else if (cur[0] === 'Z') {\n path = cur[0];\n }\n else if (cur[0] === 'C') {\n var p1 = vec3.fromValues(cur[1] - defX, cur[2] - defY, 0);\n var p2 = vec3.fromValues(cur[3] - defX, cur[4] - defY, 0);\n var p3 = vec3.fromValues(cur[5] - defX, cur[6] - defY, 0);\n if (transform) {\n vec3.transformMat4(p1, p1, transform);\n vec3.transformMat4(p2, p2, transform);\n vec3.transformMat4(p3, p3, transform);\n }\n path = \"\".concat(cur[0]).concat(p1[0], \",\").concat(p1[1], \",\").concat(p2[0], \",\").concat(p2[1], \",\").concat(p3[0], \",\").concat(p3[1]);\n }\n else if (cur[0] === 'A') {\n var c = vec3.fromValues(cur[6] - defX, cur[7] - defY, 0);\n if (transform) {\n vec3.transformMat4(c, c, transform);\n }\n path = \"\".concat(cur[0]).concat(cur[1], \",\").concat(cur[2], \",\").concat(cur[3], \",\").concat(cur[4], \",\").concat(cur[5], \",\").concat(c[0], \",\").concat(c[1]);\n }\n else if (cur[0] === 'Q') {\n var p1 = vec3.fromValues(cur[1] - defX, cur[2] - defY, 0);\n var p2 = vec3.fromValues(cur[3] - defX, cur[4] - defY, 0);\n if (transform) {\n vec3.transformMat4(p1, p1, transform);\n vec3.transformMat4(p2, p2, transform);\n }\n path = \"\".concat(cur[0]).concat(cur[1], \",\").concat(cur[2], \",\").concat(cur[3], \",\").concat(cur[4], \"}\");\n }\n return (prev += path);\n }, '');\n}\nfunction lineToCommands(x1, y1, x2, y2) {\n return [\n ['M', x1, y1],\n ['L', x2, y2],\n ];\n}\nfunction ellipseToCommands(rx, ry, cx, cy) {\n var factor = ((-1 + Math.sqrt(2)) / 3) * 4;\n var dx = rx * factor;\n var dy = ry * factor;\n var left = cx - rx;\n var right = cx + rx;\n var top = cy - ry;\n var bottom = cy + ry;\n return [\n ['M', left, cy],\n ['C', left, cy - dy, cx - dx, top, cx, top],\n ['C', cx + dx, top, right, cy - dy, right, cy],\n ['C', right, cy + dy, cx + dx, bottom, cx, bottom],\n ['C', cx - dx, bottom, left, cy + dy, left, cy],\n ['Z'],\n ];\n}\nfunction polygonToCommands(points, closed) {\n var result = points.map(function (point, i) {\n return [i === 0 ? 'M' : 'L', point[0], point[1]];\n });\n if (closed) {\n result.push(['Z']);\n }\n return result;\n}\nfunction rectToCommands(width, height, x, y, radius) {\n // @see https://gist.github.com/danielpquinn/dd966af424030d47e476\n if (radius) {\n var _a = __read(radius, 4), tlr = _a[0], trr = _a[1], brr = _a[2], blr = _a[3];\n var signX = width > 0 ? 1 : -1;\n var signY = height > 0 ? 1 : -1;\n // sweep-flag @see https://developer.mozilla.org/zh-CN/docs/Web/SVG/Tutorial/Paths#arcs\n var sweepFlag = signX + signY !== 0 ? 1 : 0;\n return [\n ['M', signX * tlr + x, y],\n ['L', width - signX * trr + x, y],\n trr ? ['A', trr, trr, 0, 0, sweepFlag, width + x, signY * trr + y] : null,\n ['L', width + x, height - signY * brr + y],\n brr\n ? ['A', brr, brr, 0, 0, sweepFlag, width + x - signX * brr, height + y]\n : null,\n ['L', x + signX * blr, height + y],\n blr\n ? ['A', blr, blr, 0, 0, sweepFlag, x, height + y - signY * blr]\n : null,\n ['L', x, signY * tlr + y],\n tlr ? ['A', tlr, tlr, 0, 0, sweepFlag, signX * tlr + x, y] : null,\n ['Z'],\n ].filter(function (command) { return command; });\n }\n return [\n ['M', x, y],\n ['L', x + width, y],\n ['L', x + width, y + height],\n ['L', x, y + height],\n ['Z'],\n ];\n}\n/**\n * convert object to path, should account for:\n * * transform & origin\n * * anchor\n * * lineWidth\n */\nfunction convertToPath(object, transform) {\n if (transform === void 0) { transform = object.getLocalTransform(); }\n var commands = [];\n switch (object.nodeName) {\n case Shape.LINE:\n var _a = object.parsedStyle, _b = _a.x1, x1 = _b === void 0 ? 0 : _b, _c = _a.y1, y1 = _c === void 0 ? 0 : _c, _d = _a.x2, x2 = _d === void 0 ? 0 : _d, _e = _a.y2, y2 = _e === void 0 ? 0 : _e;\n commands = lineToCommands(x1, y1, x2, y2);\n break;\n case Shape.CIRCLE: {\n var _f = object.parsedStyle, _g = _f.r, r = _g === void 0 ? 0 : _g, _h = _f.cx, cx = _h === void 0 ? 0 : _h, _j = _f.cy, cy = _j === void 0 ? 0 : _j;\n commands = ellipseToCommands(r, r, cx, cy);\n break;\n }\n case Shape.ELLIPSE: {\n var _k = object.parsedStyle, _l = _k.rx, rx = _l === void 0 ? 0 : _l, _m = _k.ry, ry = _m === void 0 ? 0 : _m, _o = _k.cx, cx = _o === void 0 ? 0 : _o, _p = _k.cy, cy = _p === void 0 ? 0 : _p;\n commands = ellipseToCommands(rx, ry, cx, cy);\n break;\n }\n case Shape.POLYLINE:\n case Shape.POLYGON:\n var points = object.parsedStyle.points;\n commands = polygonToCommands(points.points, object.nodeName === Shape.POLYGON);\n break;\n case Shape.RECT:\n var _q = object.parsedStyle, _r = _q.width, width_1 = _r === void 0 ? 0 : _r, _s = _q.height, height_1 = _s === void 0 ? 0 : _s, _t = _q.x, x = _t === void 0 ? 0 : _t, _u = _q.y, y = _u === void 0 ? 0 : _u, radius = _q.radius;\n var hasRadius = radius && radius.some(function (r) { return r !== 0; });\n commands = rectToCommands(width_1, height_1, x, y, hasRadius &&\n radius.map(function (r) {\n return clamp(r, 0, Math.min(Math.abs(width_1) / 2, Math.abs(height_1) / 2));\n }));\n break;\n case Shape.PATH:\n var absolutePath = object.parsedStyle.path.absolutePath;\n commands = __spreadArray([], __read(absolutePath), false);\n break;\n }\n if (commands.length) {\n return commandsToPathString(commands, object, transform);\n }\n}\nfunction translatePathToString(absolutePath, defX, defY, startOffsetX, startOffsetY, endOffsetX, endOffsetY) {\n if (startOffsetX === void 0) { startOffsetX = 0; }\n if (startOffsetY === void 0) { startOffsetY = 0; }\n if (endOffsetX === void 0) { endOffsetX = 0; }\n if (endOffsetY === void 0) { endOffsetY = 0; }\n var newValue = absolutePath\n .map(function (params, i) {\n var command = params[0];\n var nextSegment = absolutePath[i + 1];\n var useStartOffset = i === 0 && (startOffsetX !== 0 || startOffsetY !== 0);\n var useEndOffset = (i === absolutePath.length - 1 ||\n (nextSegment &&\n (nextSegment[0] === 'M' || nextSegment[0] === 'Z'))) &&\n endOffsetX !== 0 &&\n endOffsetY !== 0;\n switch (command) {\n case 'M':\n // Use start marker offset\n if (useStartOffset) {\n return \"M \".concat(params[1] - defX + startOffsetX, \",\").concat(params[2] - defY + startOffsetY, \" L \").concat(params[1] - defX, \",\").concat(params[2] - defY);\n }\n else {\n return \"M \".concat(params[1] - defX, \",\").concat(params[2] - defY);\n }\n case 'L':\n return \"L \".concat(params[1] - defX + (useEndOffset ? endOffsetX : 0), \",\").concat(params[2] - defY + (useEndOffset ? endOffsetY : 0));\n case 'Q':\n return (\"Q \".concat(params[1] - defX, \" \").concat(params[2] - defY, \",\").concat(params[3] - defX, \" \").concat(params[4] - defY) +\n (useEndOffset\n ? \" L \".concat(params[3] - defX + endOffsetX, \",\").concat(params[4] - defY + endOffsetY)\n : ''));\n case 'C':\n return (\"C \".concat(params[1] - defX, \" \").concat(params[2] - defY, \",\").concat(params[3] - defX, \" \").concat(params[4] - defY, \",\").concat(params[5] - defX, \" \").concat(params[6] - defY) +\n (useEndOffset\n ? \" L \".concat(params[5] - defX + endOffsetX, \",\").concat(params[6] - defY + endOffsetY)\n : ''));\n case 'A':\n return (\"A \".concat(params[1], \" \").concat(params[2], \" \").concat(params[3], \" \").concat(params[4], \" \").concat(params[5], \" \").concat(params[6] - defX, \" \").concat(params[7] - defY) +\n (useEndOffset\n ? \" L \".concat(params[6] - defX + endOffsetX, \",\").concat(params[7] - defY + endOffsetY)\n : ''));\n case 'Z':\n return 'Z';\n }\n })\n .join(' ');\n if (~newValue.indexOf('NaN')) {\n return '';\n }\n return newValue;\n}\n\nvar internalParsePath = function (path) {\n // empty path\n if (path === '' || (Array.isArray(path) && path.length === 0)) {\n return {\n absolutePath: [],\n hasArc: false,\n segments: [],\n polygons: [],\n polylines: [],\n curve: null,\n totalLength: 0,\n rect: {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n },\n };\n }\n var absolutePath;\n try {\n absolutePath = normalizePath(path);\n }\n catch (e) {\n absolutePath = normalizePath('');\n console.error(\"[g]: Invalid SVG Path definition: \".concat(path));\n }\n removeRedundantMCommand(absolutePath);\n var hasArc = hasArcOrBezier(absolutePath);\n var _a = extractPolygons(absolutePath), polygons = _a.polygons, polylines = _a.polylines;\n // for later use\n var segments = path2Segments(absolutePath);\n // Only calculate bbox here since we don't need length now.\n var _b = getPathBBox(segments, 0), x = _b.x, y = _b.y, width = _b.width, height = _b.height;\n return {\n absolutePath: absolutePath,\n hasArc: hasArc,\n segments: segments,\n polygons: polygons,\n polylines: polylines,\n // curve,\n // Delay the calculation of length.\n totalLength: 0,\n rect: {\n x: Number.isFinite(x) ? x : 0,\n y: Number.isFinite(y) ? y : 0,\n width: Number.isFinite(width) ? width : 0,\n height: Number.isFinite(height) ? height : 0,\n },\n };\n};\nvar memoizedParsePath = memoize(internalParsePath);\nfunction parsePath(path) {\n return (isString(path) ? memoizedParsePath(path) : internalParsePath(path));\n}\nfunction mergePaths(left, right, object) {\n var curve1 = left.curve;\n var curve2 = right.curve;\n if (!curve1 || curve1.length === 0) {\n // convert to curves to do morphing & picking later\n // @see http://thednp.github.io/kute.js/svgCubicMorph.html\n curve1 = path2Curve(left.absolutePath, false);\n left.curve = curve1;\n }\n if (!curve2 || curve2.length === 0) {\n curve2 = path2Curve(right.absolutePath, false);\n right.curve = curve2;\n }\n var curves = [curve1, curve2];\n if (curve1.length !== curve2.length) {\n curves = equalizeSegments(curve1, curve2);\n }\n var curve0 = getDrawDirection(curves[0]) !== getDrawDirection(curves[1])\n ? reverseCurve(curves[0])\n : clonePath(curves[0]);\n return [\n curve0,\n getRotatedCurve(curves[1], curve0),\n function (pathArray) {\n // need converting to path string?\n return pathArray;\n },\n ];\n}\n\n/**\n * @see https://developer.mozilla.org/zh-CN/docs/Web/SVG/Attribute/points\n *\n * @example\n * points=\"100,10 250,150 200,110\"\n */\nfunction parsePoints(pointsOrStr, object) {\n var points;\n if (isString(pointsOrStr)) {\n points = pointsOrStr.split(' ').map(function (pointStr) {\n var _a = __read(pointStr.split(','), 2), x = _a[0], y = _a[1];\n return [Number(x), Number(y)];\n });\n }\n else {\n points = pointsOrStr;\n }\n var segments = [];\n var tempLength = 0;\n var segmentT;\n var segmentL;\n var totalLength = polylineLength(points);\n points.forEach(function (p, i) {\n if (points[i + 1]) {\n segmentT = [0, 0];\n segmentT[0] = tempLength / totalLength;\n segmentL = lineLength(p[0], p[1], points[i + 1][0], points[i + 1][1]);\n tempLength += segmentL;\n segmentT[1] = tempLength / totalLength;\n segments.push(segmentT);\n }\n });\n var minX = Math.min.apply(Math, __spreadArray([], __read(points.map(function (point) { return point[0]; })), false));\n var minY = Math.min.apply(Math, __spreadArray([], __read(points.map(function (point) { return point[1]; })), false));\n if (object) {\n object.parsedStyle.defX = minX;\n object.parsedStyle.defY = minY;\n }\n return {\n points: points,\n totalLength: totalLength,\n segments: segments,\n };\n}\nfunction mergePoints(left, right) {\n return [\n left.points,\n right.points,\n function (points) {\n return points;\n },\n ];\n}\n\nvar _ = null;\nfunction cast(pattern) {\n return function (contents) {\n var i = 0;\n return pattern.map(function (x) {\n return x === _ ? contents[i++] : x;\n });\n };\n}\nfunction id(x) {\n return x;\n}\n// type: [argTypes, convertTo3D, convertTo2D]\n// In the argument types string, lowercase characters represent optional arguments\nvar transformFunctions = {\n // @ts-ignore\n matrix: ['NNNNNN', [_, _, 0, 0, _, _, 0, 0, 0, 0, 1, 0, _, _, 0, 1], id],\n matrix3d: ['NNNNNNNNNNNNNNNN', id],\n rotate: ['A'],\n rotatex: ['A'],\n rotatey: ['A'],\n rotatez: ['A'],\n rotate3d: ['NNNA'],\n perspective: ['L'],\n scale: ['Nn', cast([_, _, new CSSUnitValue(1)]), id],\n scalex: [\n 'N',\n cast([_, new CSSUnitValue(1), new CSSUnitValue(1)]),\n cast([_, new CSSUnitValue(1)]),\n ],\n scaley: [\n 'N',\n cast([new CSSUnitValue(1), _, new CSSUnitValue(1)]),\n cast([new CSSUnitValue(1), _]),\n ],\n scalez: ['N', cast([new CSSUnitValue(1), new CSSUnitValue(1), _])],\n scale3d: ['NNN', id],\n skew: ['Aa', null, id],\n skewx: ['A', null, cast([_, Odeg])],\n skewy: ['A', null, cast([Odeg, _])],\n translate: ['Tt', cast([_, _, Opx]), id],\n translatex: ['T', cast([_, Opx, Opx]), cast([_, Opx])],\n translatey: ['T', cast([Opx, _, Opx]), cast([Opx, _])],\n translatez: ['L', cast([Opx, Opx, _])],\n translate3d: ['TTL', id],\n};\n/**\n * none\n * scale(1) scale(1, 2)\n * scaleX(1)\n */\nfunction parseTransform(string) {\n string = (string || 'none').toLowerCase().trim();\n if (string === 'none') {\n return [];\n }\n var transformRegExp = /\\s*(\\w+)\\(([^)]*)\\)/g;\n var result = [];\n var match;\n var prevLastIndex = 0;\n while ((match = transformRegExp.exec(string))) {\n if (match.index !== prevLastIndex) {\n return [];\n }\n prevLastIndex = match.index + match[0].length;\n var functionName = match[1]; // scale\n var functionData = transformFunctions[functionName]; // scale(1, 2)\n if (!functionData) {\n // invalid, eg. scale()\n return [];\n }\n var args = match[2].split(','); // 1,2\n var argTypes = functionData[0]; // Nn\n if (argTypes.length < args.length) {\n // scale(N, n)\n return [];\n }\n var parsedArgs = [];\n for (var i = 0; i < argTypes.length; i++) {\n var arg = args[i];\n var type = argTypes[i];\n var parsedArg = void 0;\n if (!arg) {\n // @ts-ignore\n parsedArg = {\n a: Odeg,\n n: parsedArgs[0],\n t: Opx,\n }[type];\n }\n else {\n // @ts-ignore\n parsedArg = {\n A: function (s) {\n return s.trim() === '0' ? Odeg : parseAngle(s);\n },\n N: parseNumber,\n T: parseLengthOrPercentage,\n L: parseLength,\n }[type.toUpperCase()](arg);\n }\n if (parsedArg === undefined) {\n return [];\n }\n parsedArgs.push(parsedArg);\n }\n result.push({ t: functionName, d: parsedArgs }); // { t: scale, d: [1, 2] }\n if (transformRegExp.lastIndex === string.length) {\n return result;\n }\n }\n return [];\n}\nfunction parseTransformUnmemoize(string) {\n string = (string || 'none').toLowerCase().trim();\n if (string === 'none') {\n return [];\n }\n var transformRegExp = /\\s*(\\w+)\\(([^)]*)\\)/g;\n var result = [];\n var match;\n var prevLastIndex = 0;\n while ((match = transformRegExp.exec(string))) {\n if (match.index !== prevLastIndex) {\n return [];\n }\n prevLastIndex = match.index + match[0].length;\n var functionName = match[1]; // scale\n var functionData = transformFunctions[functionName]; // scale(1, 2)\n if (!functionData) {\n // invalid, eg. scale()\n return [];\n }\n var args = match[2].split(','); // 1,2\n var argTypes = functionData[0]; // Nn\n if (argTypes.length < args.length) {\n // scale(N, n)\n return [];\n }\n var parsedArgs = [];\n for (var i = 0; i < argTypes.length; i++) {\n var arg = args[i];\n var type = argTypes[i];\n var parsedArg = void 0;\n if (!arg) {\n // @ts-ignore\n parsedArg = {\n a: Odeg,\n n: parsedArgs[0],\n t: Opx,\n }[type];\n }\n else {\n // @ts-ignore\n parsedArg = {\n A: function (s) {\n return s.trim() === '0' ? Odeg : parseAngleUnmemoize(s);\n },\n N: parseNumberUnmemoize,\n T: parseLengthOrPercentageUnmemoize,\n L: parseLengthUnmemoize,\n }[type.toUpperCase()](arg);\n }\n if (parsedArg === undefined) {\n return [];\n }\n parsedArgs.push(parsedArg);\n }\n result.push({ t: functionName, d: parsedArgs }); // { t: scale, d: [1, 2] }\n if (transformRegExp.lastIndex === string.length) {\n return result;\n }\n }\n return [];\n}\nfunction convertItemToMatrix(item) {\n var x;\n var y;\n var z;\n var angle;\n switch (item.t) {\n case 'rotatex':\n angle = deg2rad(convertAngleUnit(item.d[0]));\n return [\n 1,\n 0,\n 0,\n 0,\n 0,\n Math.cos(angle),\n Math.sin(angle),\n 0,\n 0,\n -Math.sin(angle),\n Math.cos(angle),\n 0,\n 0,\n 0,\n 0,\n 1,\n ];\n case 'rotatey':\n angle = deg2rad(convertAngleUnit(item.d[0]));\n return [\n Math.cos(angle),\n 0,\n -Math.sin(angle),\n 0,\n 0,\n 1,\n 0,\n 0,\n Math.sin(angle),\n 0,\n Math.cos(angle),\n 0,\n 0,\n 0,\n 0,\n 1,\n ];\n case 'rotate':\n case 'rotatez':\n angle = deg2rad(convertAngleUnit(item.d[0]));\n return [\n Math.cos(angle),\n Math.sin(angle),\n 0,\n 0,\n -Math.sin(angle),\n Math.cos(angle),\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n ];\n case 'rotate3d':\n x = item.d[0].value;\n y = item.d[1].value;\n z = item.d[2].value;\n angle = deg2rad(convertAngleUnit(item.d[3]));\n var sqrLength = x * x + y * y + z * z;\n if (sqrLength === 0) {\n x = 1;\n y = 0;\n z = 0;\n }\n else if (sqrLength !== 1) {\n var length_1 = Math.sqrt(sqrLength);\n x /= length_1;\n y /= length_1;\n z /= length_1;\n }\n var s = Math.sin(angle / 2);\n var sc = s * Math.cos(angle / 2);\n var sq = s * s;\n return [\n 1 - 2 * (y * y + z * z) * sq,\n 2 * (x * y * sq + z * sc),\n 2 * (x * z * sq - y * sc),\n 0,\n 2 * (x * y * sq - z * sc),\n 1 - 2 * (x * x + z * z) * sq,\n 2 * (y * z * sq + x * sc),\n 0,\n 2 * (x * z * sq + y * sc),\n 2 * (y * z * sq - x * sc),\n 1 - 2 * (x * x + y * y) * sq,\n 0,\n 0,\n 0,\n 0,\n 1,\n ];\n case 'scale':\n return [\n item.d[0].value,\n 0,\n 0,\n 0,\n 0,\n item.d[1].value,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n ];\n case 'scalex':\n return [item.d[0].value, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n case 'scaley':\n return [1, 0, 0, 0, 0, item.d[0].value, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n case 'scalez':\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, item.d[0].value, 0, 0, 0, 0, 1];\n case 'scale3d':\n return [\n item.d[0].value,\n 0,\n 0,\n 0,\n 0,\n item.d[1].value,\n 0,\n 0,\n 0,\n 0,\n item.d[2].value,\n 0,\n 0,\n 0,\n 0,\n 1,\n ];\n case 'skew':\n var xAngle = deg2rad(convertAngleUnit(item.d[0]));\n var yAngle = deg2rad(convertAngleUnit(item.d[1]));\n return [\n 1,\n Math.tan(yAngle),\n 0,\n 0,\n Math.tan(xAngle),\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n ];\n case 'skewx':\n angle = deg2rad(convertAngleUnit(item.d[0]));\n return [1, 0, 0, 0, Math.tan(angle), 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n case 'skewy':\n angle = deg2rad(convertAngleUnit(item.d[0]));\n return [1, Math.tan(angle), 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n case 'translate':\n // TODO: pass target\n x = convertPercentUnit(item.d[0], 0, null) || 0;\n y = convertPercentUnit(item.d[1], 0, null) || 0;\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, x, y, 0, 1];\n case 'translatex':\n x = convertPercentUnit(item.d[0], 0, null) || 0;\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, x, 0, 0, 1];\n case 'translatey':\n y = convertPercentUnit(item.d[0], 0, null) || 0;\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, y, 0, 1];\n case 'translatez':\n z = convertPercentUnit(item.d[0], 0, null) || 0;\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, z, 1];\n case 'translate3d':\n x = convertPercentUnit(item.d[0], 0, null) || 0;\n y = convertPercentUnit(item.d[1], 0, null) || 0;\n z = convertPercentUnit(item.d[2], 0, null) || 0;\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, x, y, z, 1];\n case 'perspective':\n var t = convertPercentUnit(item.d[0], 0, null) || 0;\n var p = t ? -1 / t : 0;\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, p, 0, 0, 0, 1];\n case 'matrix':\n return [\n item.d[0].value,\n item.d[1].value,\n 0,\n 0,\n item.d[2].value,\n item.d[3].value,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n item.d[4].value,\n item.d[5].value,\n 0,\n 1,\n ];\n case 'matrix3d':\n return item.d.map(function (d) { return d.value; });\n }\n}\nfunction multiplyMatrices(a, b) {\n return [\n a[0] * b[0] + a[4] * b[1] + a[8] * b[2] + a[12] * b[3],\n a[1] * b[0] + a[5] * b[1] + a[9] * b[2] + a[13] * b[3],\n a[2] * b[0] + a[6] * b[1] + a[10] * b[2] + a[14] * b[3],\n a[3] * b[0] + a[7] * b[1] + a[11] * b[2] + a[15] * b[3],\n a[0] * b[4] + a[4] * b[5] + a[8] * b[6] + a[12] * b[7],\n a[1] * b[4] + a[5] * b[5] + a[9] * b[6] + a[13] * b[7],\n a[2] * b[4] + a[6] * b[5] + a[10] * b[6] + a[14] * b[7],\n a[3] * b[4] + a[7] * b[5] + a[11] * b[6] + a[15] * b[7],\n a[0] * b[8] + a[4] * b[9] + a[8] * b[10] + a[12] * b[11],\n a[1] * b[8] + a[5] * b[9] + a[9] * b[10] + a[13] * b[11],\n a[2] * b[8] + a[6] * b[9] + a[10] * b[10] + a[14] * b[11],\n a[3] * b[8] + a[7] * b[9] + a[11] * b[10] + a[15] * b[11],\n a[0] * b[12] + a[4] * b[13] + a[8] * b[14] + a[12] * b[15],\n a[1] * b[12] + a[5] * b[13] + a[9] * b[14] + a[13] * b[15],\n a[2] * b[12] + a[6] * b[13] + a[10] * b[14] + a[14] * b[15],\n a[3] * b[12] + a[7] * b[13] + a[11] * b[14] + a[15] * b[15],\n ];\n}\nfunction convertToMatrix(transformList) {\n if (transformList.length === 0) {\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n }\n return transformList.map(convertItemToMatrix).reduce(multiplyMatrices);\n}\nfunction makeMatrixDecomposition(transformList) {\n var translate = [0, 0, 0];\n var scale = [1, 1, 1];\n var skew = [0, 0, 0];\n var perspective = [0, 0, 0, 1];\n var quaternion = [0, 0, 0, 1];\n decomposeMat4(\n // @ts-ignore\n convertToMatrix(transformList), translate, scale, skew, perspective, quaternion);\n return [[translate, scale, skew, quaternion, perspective]];\n}\nvar composeMatrix = (function () {\n function multiply(a, b) {\n var result = [\n [0, 0, 0, 0],\n [0, 0, 0, 0],\n [0, 0, 0, 0],\n [0, 0, 0, 0],\n ];\n for (var i = 0; i < 4; i++) {\n for (var j = 0; j < 4; j++) {\n for (var k = 0; k < 4; k++) {\n result[i][j] += b[i][k] * a[k][j];\n }\n }\n }\n return result;\n }\n function is2D(m) {\n return (m[0][2] == 0 &&\n m[0][3] == 0 &&\n m[1][2] == 0 &&\n m[1][3] == 0 &&\n m[2][0] == 0 &&\n m[2][1] == 0 &&\n m[2][2] == 1 &&\n m[2][3] == 0 &&\n m[3][2] == 0 &&\n m[3][3] == 1);\n }\n function composeMatrix(translate, scale, skew, quat, perspective) {\n var matrix = [\n [1, 0, 0, 0],\n [0, 1, 0, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1],\n ];\n for (var i = 0; i < 4; i++) {\n matrix[i][3] = perspective[i];\n }\n for (var i = 0; i < 3; i++) {\n for (var j = 0; j < 3; j++) {\n matrix[3][i] += translate[j] * matrix[j][i];\n }\n }\n var x = quat[0], y = quat[1], z = quat[2], w = quat[3];\n var rotMatrix = [\n [1, 0, 0, 0],\n [0, 1, 0, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1],\n ];\n rotMatrix[0][0] = 1 - 2 * (y * y + z * z);\n rotMatrix[0][1] = 2 * (x * y - z * w);\n rotMatrix[0][2] = 2 * (x * z + y * w);\n rotMatrix[1][0] = 2 * (x * y + z * w);\n rotMatrix[1][1] = 1 - 2 * (x * x + z * z);\n rotMatrix[1][2] = 2 * (y * z - x * w);\n rotMatrix[2][0] = 2 * (x * z - y * w);\n rotMatrix[2][1] = 2 * (y * z + x * w);\n rotMatrix[2][2] = 1 - 2 * (x * x + y * y);\n matrix = multiply(matrix, rotMatrix);\n var temp = [\n [1, 0, 0, 0],\n [0, 1, 0, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1],\n ];\n if (skew[2]) {\n temp[2][1] = skew[2];\n matrix = multiply(matrix, temp);\n }\n if (skew[1]) {\n temp[2][1] = 0;\n temp[2][0] = skew[0];\n matrix = multiply(matrix, temp);\n }\n if (skew[0]) {\n temp[2][0] = 0;\n temp[1][0] = skew[0];\n matrix = multiply(matrix, temp);\n }\n for (var i = 0; i < 3; i++) {\n for (var j = 0; j < 3; j++) {\n matrix[i][j] *= scale[i];\n }\n }\n if (is2D(matrix)) {\n return [\n matrix[0][0],\n matrix[0][1],\n matrix[1][0],\n matrix[1][1],\n matrix[3][0],\n matrix[3][1],\n ];\n }\n return matrix[0].concat(matrix[1], matrix[2], matrix[3]);\n }\n return composeMatrix;\n})();\nfunction numberToLongString(x) {\n return x.toFixed(6).replace('.000000', '');\n}\nfunction mergeMatrices(left, right) {\n var leftArgs;\n var rightArgs;\n // @ts-ignore\n if (left.decompositionPair !== right) {\n // @ts-ignore\n left.decompositionPair = right;\n // @ts-ignore\n leftArgs = makeMatrixDecomposition(left);\n }\n // @ts-ignore\n if (right.decompositionPair !== left) {\n // @ts-ignore\n right.decompositionPair = left;\n // @ts-ignore\n rightArgs = makeMatrixDecomposition(right);\n }\n if (leftArgs[0] === null || rightArgs[0] === null)\n return [\n // @ts-ignore\n [false],\n // @ts-ignore\n [true],\n // @ts-ignore\n function (x) {\n return x ? right[0].d : left[0].d;\n },\n ];\n leftArgs[0].push(0);\n rightArgs[0].push(1);\n return [\n leftArgs,\n rightArgs,\n // @ts-ignore\n function (list) {\n // @ts-ignore\n var q = quat(leftArgs[0][3], rightArgs[0][3], list[5]);\n var mat = composeMatrix(list[0], list[1], list[2], q, list[4]);\n var stringifiedArgs = mat.map(numberToLongString).join(',');\n return stringifiedArgs;\n },\n ];\n}\nfunction dot(v1, v2) {\n var result = 0;\n for (var i = 0; i < v1.length; i++) {\n result += v1[i] * v2[i];\n }\n return result;\n}\nfunction quat(fromQ, toQ, f) {\n var product = dot(fromQ, toQ);\n product = clamp(product, -1.0, 1.0);\n var quat = [];\n if (product === 1.0) {\n quat = fromQ;\n }\n else {\n var theta = Math.acos(product);\n var w = (Math.sin(f * theta) * 1) / Math.sqrt(1 - product * product);\n for (var i = 0; i < 4; i++) {\n quat.push(fromQ[i] * (Math.cos(f * theta) - product * w) + toQ[i] * w);\n }\n }\n return quat;\n}\n// scalex/y/z -> scale\nfunction typeTo2D(type) {\n return type.replace(/[xy]/, '');\n}\n// scalex/y/z -> scale3d\nfunction typeTo3D(type) {\n return type.replace(/(x|y|z|3d)?$/, '3d');\n}\nvar isMatrixOrPerspective = function (lt, rt) {\n return ((lt === 'perspective' && rt === 'perspective') ||\n ((lt === 'matrix' || lt === 'matrix3d') &&\n (rt === 'matrix' || rt === 'matrix3d')));\n};\nfunction mergeTransforms(left, right, target) {\n var flipResults = false;\n // padding empty transform, eg. merge 'scale(10)' with 'none' -> scale(1)\n if (!left.length || !right.length) {\n if (!left.length) {\n flipResults = true;\n left = right;\n right = [];\n }\n var _loop_1 = function (i) {\n var _a = left[i], type = _a.t, args = _a.d;\n // none -> scale(1)/translateX(0)\n var defaultValue = type.substring(0, 5) === 'scale' ? 1 : 0;\n right.push({\n t: type,\n d: args.map(function (arg) {\n if (typeof arg === 'number') {\n return getOrCreateUnitValue(defaultValue);\n }\n return getOrCreateUnitValue(defaultValue, arg.unit);\n // {\n // unit: arg.unit,\n // value: defaultValue,\n // };\n }),\n });\n };\n for (var i = 0; i < left.length; i++) {\n _loop_1(i);\n }\n }\n var leftResult = [];\n var rightResult = [];\n var types = [];\n // merge matrix() with matrix3d()\n if (left.length !== right.length) {\n var merged = mergeMatrices(left, right);\n // @ts-ignore\n leftResult = [merged[0]];\n // @ts-ignore\n rightResult = [merged[1]];\n types = [['matrix', [merged[2]]]];\n }\n else {\n for (var i = 0; i < left.length; i++) {\n var leftType = left[i].t;\n var rightType = right[i].t;\n var leftArgs = left[i].d;\n var rightArgs = right[i].d;\n var leftFunctionData = transformFunctions[leftType];\n var rightFunctionData = transformFunctions[rightType];\n var type = void 0;\n if (isMatrixOrPerspective(leftType, rightType)) {\n var merged = mergeMatrices([left[i]], [right[i]]);\n // @ts-ignore\n leftResult.push(merged[0]);\n // @ts-ignore\n rightResult.push(merged[1]);\n types.push(['matrix', [merged[2]]]);\n continue;\n }\n else if (leftType === rightType) {\n type = leftType;\n }\n else if (leftFunctionData[2] &&\n rightFunctionData[2] &&\n typeTo2D(leftType) === typeTo2D(rightType)) {\n type = typeTo2D(leftType);\n // @ts-ignore\n leftArgs = leftFunctionData[2](leftArgs);\n // @ts-ignore\n rightArgs = rightFunctionData[2](rightArgs);\n }\n else if (leftFunctionData[1] &&\n rightFunctionData[1] &&\n typeTo3D(leftType) === typeTo3D(rightType)) {\n type = typeTo3D(leftType);\n // @ts-ignore\n leftArgs = leftFunctionData[1](leftArgs);\n // @ts-ignore\n rightArgs = rightFunctionData[1](rightArgs);\n }\n else {\n var merged = mergeMatrices(left, right);\n // @ts-ignore\n leftResult = [merged[0]];\n // @ts-ignore\n rightResult = [merged[1]];\n types = [['matrix', [merged[2]]]];\n break;\n }\n var leftArgsCopy = [];\n var rightArgsCopy = [];\n var stringConversions = [];\n for (var j = 0; j < leftArgs.length; j++) {\n // const merge = leftArgs[j].unit === UnitType.kNumber ? mergeDimensions : mergeDimensions;\n var merged = mergeDimensions(leftArgs[j], rightArgs[j], target, false, j);\n leftArgsCopy[j] = merged[0];\n rightArgsCopy[j] = merged[1];\n stringConversions.push(merged[2]);\n }\n leftResult.push(leftArgsCopy);\n rightResult.push(rightArgsCopy);\n types.push([type, stringConversions]);\n }\n }\n if (flipResults) {\n var tmp = leftResult;\n leftResult = rightResult;\n rightResult = tmp;\n }\n return [\n leftResult,\n rightResult,\n function (list) {\n return list\n .map(function (args, i) {\n var stringifiedArgs = args\n .map(function (arg, j) {\n return types[i][1][j](arg);\n })\n .join(',');\n if (types[i][0] === 'matrix' &&\n stringifiedArgs.split(',').length === 16) {\n types[i][0] = 'matrix3d';\n }\n if (types[i][0] === 'matrix3d' &&\n stringifiedArgs.split(',').length === 6) {\n types[i][0] = 'matrix';\n }\n return types[i][0] + '(' + stringifiedArgs + ')';\n })\n .join(' ');\n },\n ];\n}\n\n/**\n * @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/transform-origin\n * eg. 'center' 'top left' '50px 50px'\n */\nvar parseTransformOrigin = memoize(function (value) {\n if (isString(value)) {\n if (value === 'text-anchor') {\n return [getOrCreateUnitValue(0, 'px'), getOrCreateUnitValue(0, 'px')];\n }\n var values = value.split(' ');\n if (values.length === 1) {\n if (values[0] === 'top' || values[0] === 'bottom') {\n // 'top' -> 'center top'\n values[1] = values[0];\n values[0] = 'center';\n }\n else {\n // '50px' -> '50px center'\n values[1] = 'center';\n }\n }\n if (values.length !== 2) {\n return null;\n }\n // eg. center bottom\n return [\n parseLengthOrPercentage(convertKeyword2Percent(values[0])),\n parseLengthOrPercentage(convertKeyword2Percent(values[1])),\n ];\n }\n else {\n return [\n getOrCreateUnitValue(value[0] || 0, 'px'),\n getOrCreateUnitValue(value[1] || 0, 'px'),\n ];\n }\n});\nvar parseTransformOriginUnmemoize = function (value) {\n if (isString(value)) {\n if (value === 'text-anchor') {\n return [getOrCreateUnitValue(0, 'px'), getOrCreateUnitValue(0, 'px')];\n }\n var values = value.split(' ');\n if (values.length === 1) {\n if (values[0] === 'top' || values[0] === 'bottom') {\n // 'top' -> 'center top'\n values[1] = values[0];\n values[0] = 'center';\n }\n else {\n // '50px' -> '50px center'\n values[1] = 'center';\n }\n }\n if (values.length !== 2) {\n return null;\n }\n // eg. center bottom\n return [\n parseLengthOrPercentageUnmemoize(convertKeyword2Percent(values[0])),\n parseLengthOrPercentageUnmemoize(convertKeyword2Percent(values[1])),\n ];\n }\n else {\n return [\n getOrCreateUnitValue(value[0] || 0, 'px'),\n getOrCreateUnitValue(value[1] || 0, 'px'),\n ];\n }\n};\nfunction convertKeyword2Percent(keyword) {\n if (keyword === 'center') {\n return '50%';\n }\n else if (keyword === 'left' || keyword === 'top') {\n return '0';\n }\n else if (keyword === 'right' || keyword === 'bottom') {\n return '100%';\n }\n return keyword;\n}\n\n/**\n * Blink used them in code generation(css_properties.json5)\n */\nvar BUILT_IN_PROPERTIES = [\n {\n /**\n * used in CSS Layout API\n * eg. `display: 'flex'`\n */\n n: 'display',\n k: ['none'],\n },\n {\n /**\n * range [0.0, 1.0]\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/opacity\n */\n n: 'opacity',\n int: true,\n inh: true,\n d: '1',\n syntax: PropertySyntax.OPACITY_VALUE,\n },\n {\n /**\n * inheritable, range [0.0, 1.0]\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-opacity\n * @see https://svgwg.org/svg2-draft/painting.html#FillOpacity\n */\n n: 'fillOpacity',\n int: true,\n inh: true,\n d: '1',\n syntax: PropertySyntax.OPACITY_VALUE,\n },\n {\n /**\n * inheritable, range [0.0, 1.0]\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-opacity\n * @see https://svgwg.org/svg2-draft/painting.html#StrokeOpacity\n */\n n: 'strokeOpacity',\n int: true,\n inh: true,\n d: '1',\n syntax: PropertySyntax.OPACITY_VALUE,\n },\n {\n /**\n * background-color is not inheritable\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Fills_and_Strokes\n */\n n: 'fill',\n int: true,\n k: ['none'],\n d: 'none',\n syntax: PropertySyntax.PAINT,\n },\n {\n n: 'fillRule',\n k: ['nonzero', 'evenodd'],\n d: 'nonzero',\n },\n /**\n * default to none\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke#usage_notes\n */\n {\n n: 'stroke',\n int: true,\n k: ['none'],\n d: 'none',\n syntax: PropertySyntax.PAINT,\n /**\n * Stroke 'none' won't affect geometry but others will.\n */\n l: true,\n },\n {\n n: 'shadowType',\n k: ['inner', 'outer', 'both'],\n d: 'outer',\n l: true,\n },\n {\n n: 'shadowColor',\n int: true,\n syntax: PropertySyntax.COLOR,\n },\n {\n n: 'shadowOffsetX',\n int: true,\n l: true,\n d: '0',\n syntax: PropertySyntax.LENGTH_PERCENTAGE,\n },\n {\n n: 'shadowOffsetY',\n int: true,\n l: true,\n d: '0',\n syntax: PropertySyntax.LENGTH_PERCENTAGE,\n },\n {\n n: 'shadowBlur',\n int: true,\n l: true,\n d: '0',\n syntax: PropertySyntax.SHADOW_BLUR,\n },\n {\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width\n */\n n: 'lineWidth',\n int: true,\n inh: true,\n d: '1',\n l: true,\n a: ['strokeWidth'],\n syntax: PropertySyntax.LENGTH_PERCENTAGE,\n },\n {\n n: 'increasedLineWidthForHitTesting',\n inh: true,\n d: '0',\n l: true,\n syntax: PropertySyntax.LENGTH_PERCENTAGE,\n },\n {\n n: 'lineJoin',\n inh: true,\n l: true,\n a: ['strokeLinejoin'],\n k: ['miter', 'bevel', 'round'],\n d: 'miter',\n },\n {\n n: 'lineCap',\n inh: true,\n l: true,\n a: ['strokeLinecap'],\n k: ['butt', 'round', 'square'],\n d: 'butt',\n },\n {\n n: 'lineDash',\n int: true,\n inh: true,\n k: ['none'],\n a: ['strokeDasharray'],\n syntax: PropertySyntax.LENGTH_PERCENTAGE_12,\n },\n {\n n: 'lineDashOffset',\n int: true,\n inh: true,\n d: '0',\n a: ['strokeDashoffset'],\n syntax: PropertySyntax.LENGTH_PERCENTAGE,\n },\n {\n n: 'offsetPath',\n syntax: PropertySyntax.DEFINED_PATH,\n },\n {\n n: 'offsetDistance',\n int: true,\n syntax: PropertySyntax.OFFSET_DISTANCE,\n },\n {\n n: 'dx',\n int: true,\n l: true,\n d: '0',\n syntax: PropertySyntax.LENGTH_PERCENTAGE,\n },\n {\n n: 'dy',\n int: true,\n l: true,\n d: '0',\n syntax: PropertySyntax.LENGTH_PERCENTAGE,\n },\n {\n n: 'zIndex',\n ind: true,\n int: true,\n d: '0',\n k: ['auto'],\n syntax: PropertySyntax.Z_INDEX,\n },\n {\n n: 'visibility',\n k: ['visible', 'hidden'],\n ind: true,\n inh: true,\n /**\n * support interpolation\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/visibility#interpolation\n */\n int: true,\n d: 'visible',\n },\n {\n n: 'pointerEvents',\n inh: true,\n k: [\n 'none',\n 'auto',\n 'stroke',\n 'fill',\n 'painted',\n 'visible',\n 'visiblestroke',\n 'visiblefill',\n 'visiblepainted',\n // 'bounding-box',\n 'all',\n ],\n d: 'auto',\n },\n {\n n: 'filter',\n ind: true,\n l: true,\n k: ['none'],\n d: 'none',\n syntax: PropertySyntax.FILTER,\n },\n {\n n: 'clipPath',\n syntax: PropertySyntax.DEFINED_PATH,\n },\n {\n n: 'textPath',\n syntax: PropertySyntax.DEFINED_PATH,\n },\n {\n n: 'textPathSide',\n k: ['left', 'right'],\n d: 'left',\n },\n {\n n: 'textPathStartOffset',\n l: true,\n d: '0',\n syntax: PropertySyntax.LENGTH_PERCENTAGE,\n },\n {\n n: 'transform',\n p: 100,\n int: true,\n k: ['none'],\n d: 'none',\n syntax: PropertySyntax.TRANSFORM,\n },\n {\n n: 'transformOrigin',\n p: 100,\n // int: true,\n d: function (nodeName) {\n if (nodeName === Shape.CIRCLE || nodeName === Shape.ELLIPSE) {\n return 'center';\n }\n if (nodeName === Shape.TEXT) {\n return 'text-anchor';\n }\n return 'left top';\n },\n l: true,\n syntax: PropertySyntax.TRANSFORM_ORIGIN,\n },\n {\n n: 'anchor',\n p: 99,\n d: function (nodeName) {\n if (nodeName === Shape.CIRCLE || nodeName === Shape.ELLIPSE) {\n return '0.5 0.5';\n }\n return '0 0';\n },\n l: true,\n syntax: PropertySyntax.LENGTH_PERCENTAGE_12,\n },\n // & \n {\n n: 'cx',\n int: true,\n d: '0',\n syntax: PropertySyntax.COORDINATE,\n },\n {\n n: 'cy',\n int: true,\n d: '0',\n syntax: PropertySyntax.COORDINATE,\n },\n {\n n: 'cz',\n int: true,\n d: '0',\n syntax: PropertySyntax.COORDINATE,\n },\n {\n n: 'r',\n int: true,\n l: true,\n d: '0',\n syntax: PropertySyntax.LENGTH_PERCENTAGE,\n },\n {\n n: 'rx',\n int: true,\n l: true,\n d: '0',\n syntax: PropertySyntax.LENGTH_PERCENTAGE,\n },\n {\n n: 'ry',\n int: true,\n l: true,\n d: '0',\n syntax: PropertySyntax.LENGTH_PERCENTAGE,\n },\n // Rect Image Group\n {\n // x in local space\n n: 'x',\n int: true,\n d: '0',\n syntax: PropertySyntax.COORDINATE,\n },\n {\n // y in local space\n n: 'y',\n int: true,\n d: '0',\n syntax: PropertySyntax.COORDINATE,\n },\n {\n // z in local space\n n: 'z',\n int: true,\n d: '0',\n syntax: PropertySyntax.COORDINATE,\n },\n {\n n: 'width',\n int: true,\n l: true,\n /**\n * @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/width\n */\n k: ['auto', 'fit-content', 'min-content', 'max-content'],\n d: '0',\n syntax: PropertySyntax.LENGTH_PERCENTAGE,\n },\n {\n n: 'height',\n int: true,\n l: true,\n /**\n * @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/height\n */\n k: ['auto', 'fit-content', 'min-content', 'max-content'],\n d: '0',\n syntax: PropertySyntax.LENGTH_PERCENTAGE,\n },\n {\n n: 'radius',\n int: true,\n l: true,\n d: '0',\n syntax: PropertySyntax.LENGTH_PERCENTAGE_14,\n },\n // Line\n {\n n: 'x1',\n int: true,\n l: true,\n syntax: PropertySyntax.COORDINATE,\n },\n {\n n: 'y1',\n int: true,\n l: true,\n syntax: PropertySyntax.COORDINATE,\n },\n {\n n: 'z1',\n int: true,\n l: true,\n syntax: PropertySyntax.COORDINATE,\n },\n {\n n: 'x2',\n int: true,\n l: true,\n syntax: PropertySyntax.COORDINATE,\n },\n {\n n: 'y2',\n int: true,\n l: true,\n syntax: PropertySyntax.COORDINATE,\n },\n {\n n: 'z2',\n int: true,\n l: true,\n syntax: PropertySyntax.COORDINATE,\n },\n // Path\n {\n n: 'path',\n int: true,\n l: true,\n d: '',\n a: ['d'],\n syntax: PropertySyntax.PATH,\n p: 50,\n },\n // Polyline & Polygon\n {\n n: 'points',\n /**\n * support interpolation\n */\n int: true,\n l: true,\n syntax: PropertySyntax.LIST_OF_POINTS,\n p: 50,\n },\n // Text\n {\n n: 'text',\n l: true,\n d: '',\n syntax: PropertySyntax.TEXT,\n p: 50,\n },\n {\n n: 'textTransform',\n l: true,\n inh: true,\n k: ['capitalize', 'uppercase', 'lowercase', 'none'],\n d: 'none',\n syntax: PropertySyntax.TEXT_TRANSFORM,\n p: 51, // it must get parsed after text\n },\n {\n n: 'font',\n l: true,\n },\n {\n n: 'fontSize',\n int: true,\n inh: true,\n /**\n * @see https://www.w3schools.com/css/css_font_size.asp\n */\n d: '16px',\n l: true,\n syntax: PropertySyntax.LENGTH_PERCENTAGE,\n },\n {\n n: 'fontFamily',\n l: true,\n inh: true,\n d: 'sans-serif',\n },\n {\n n: 'fontStyle',\n l: true,\n inh: true,\n k: ['normal', 'italic', 'oblique'],\n d: 'normal',\n },\n {\n n: 'fontWeight',\n l: true,\n inh: true,\n k: ['normal', 'bold', 'bolder', 'lighter'],\n d: 'normal',\n },\n {\n n: 'fontVariant',\n l: true,\n inh: true,\n k: ['normal', 'small-caps'],\n d: 'normal',\n },\n {\n n: 'lineHeight',\n l: true,\n syntax: PropertySyntax.LENGTH,\n int: true,\n d: '0',\n },\n {\n n: 'letterSpacing',\n l: true,\n syntax: PropertySyntax.LENGTH,\n int: true,\n d: '0',\n },\n {\n n: 'miterLimit',\n l: true,\n syntax: PropertySyntax.NUMBER,\n d: function (nodeName) {\n if (nodeName === Shape.PATH ||\n nodeName === Shape.POLYGON ||\n nodeName === Shape.POLYLINE) {\n return '4';\n }\n return '10';\n },\n },\n {\n n: 'wordWrap',\n l: true,\n },\n {\n n: 'wordWrapWidth',\n l: true,\n },\n {\n n: 'maxLines',\n l: true,\n },\n {\n n: 'textOverflow',\n l: true,\n d: 'clip',\n },\n {\n n: 'leading',\n l: true,\n },\n {\n n: 'textBaseline',\n l: true,\n inh: true,\n k: ['top', 'hanging', 'middle', 'alphabetic', 'ideographic', 'bottom'],\n d: 'alphabetic',\n },\n {\n n: 'textAlign',\n l: true,\n inh: true,\n k: ['start', 'center', 'middle', 'end', 'left', 'right'],\n d: 'start',\n },\n // {\n // n: 'whiteSpace',\n // l: true,\n // },\n {\n n: 'markerStart',\n syntax: PropertySyntax.MARKER,\n },\n {\n n: 'markerEnd',\n syntax: PropertySyntax.MARKER,\n },\n {\n n: 'markerMid',\n syntax: PropertySyntax.MARKER,\n },\n {\n n: 'markerStartOffset',\n syntax: PropertySyntax.LENGTH,\n l: true,\n int: true,\n d: '0',\n },\n {\n n: 'markerEndOffset',\n syntax: PropertySyntax.LENGTH,\n l: true,\n int: true,\n d: '0',\n },\n];\nvar GEOMETRY_ATTRIBUTE_NAMES = BUILT_IN_PROPERTIES.filter(function (n) { return !!n.l; }).map(function (n) { return n.n; });\nvar propertyMetadataCache = {};\nvar unresolvedProperties = new WeakMap();\n// const uniqueAttributeSet = new Set();\n// const tmpVec3a = vec3.create();\n// const tmpVec3b = vec3.create();\n// const tmpVec3c = vec3.create();\nvar isPropertyResolved = function (object, name) {\n var properties = unresolvedProperties.get(object);\n if (!properties || properties.length === 0) {\n return true;\n }\n return properties.includes(name);\n};\nvar DefaultStyleValueRegistry = /** @class */ (function () {\n /**\n * need recalc later\n */\n // dirty = false;\n function DefaultStyleValueRegistry(runtime) {\n var _this = this;\n this.runtime = runtime;\n BUILT_IN_PROPERTIES.forEach(function (property) {\n _this.registerMetadata(property);\n });\n }\n DefaultStyleValueRegistry.prototype.registerMetadata = function (metadata) {\n __spreadArray([metadata.n], __read((metadata.a || [])), false).forEach(function (name) {\n propertyMetadataCache[name] = metadata;\n });\n };\n DefaultStyleValueRegistry.prototype.unregisterMetadata = function (name) {\n delete propertyMetadataCache[name];\n };\n DefaultStyleValueRegistry.prototype.getPropertySyntax = function (syntax) {\n return this.runtime.CSSPropertySyntaxFactory[syntax];\n };\n /**\n * * parse value, eg.\n * fill: 'red' => CSSRGB\n * translateX: '10px' => CSSUnitValue { unit: 'px', value: 10 }\n * fontSize: '2em' => { unit: 'px', value: 32 }\n *\n * * calculate used value\n * * post process\n */\n DefaultStyleValueRegistry.prototype.processProperties = function (object, attributes, options) {\n var _this = this;\n if (options === void 0) { options = {\n skipUpdateAttribute: false,\n skipParse: false,\n forceUpdateGeometry: false,\n usedAttributes: [],\n memoize: true,\n }; }\n if (!this.runtime.enableCSSParsing) {\n Object.assign(object.attributes, attributes);\n var attributeNames_1 = Object.keys(attributes);\n // clipPath\n var oldClipPath = object.parsedStyle.clipPath;\n var oldOffsetPath = object.parsedStyle.offsetPath;\n object.parsedStyle = Object.assign(object.parsedStyle, attributes);\n var needUpdateGeometry_1 = !!options.forceUpdateGeometry;\n if (!needUpdateGeometry_1) {\n for (var i = 0; i < GEOMETRY_ATTRIBUTE_NAMES.length; i++) {\n if (GEOMETRY_ATTRIBUTE_NAMES[i] in attributes) {\n needUpdateGeometry_1 = true;\n break;\n }\n }\n }\n if (attributes.fill) {\n object.parsedStyle.fill = parseColor(attributes.fill);\n }\n if (attributes.stroke) {\n object.parsedStyle.stroke = parseColor(attributes.stroke);\n }\n if (attributes.shadowColor) {\n object.parsedStyle.shadowColor = parseColor(attributes.shadowColor);\n }\n if (attributes.filter) {\n object.parsedStyle.filter = parseFilter(attributes.filter);\n }\n // Rect\n // @ts-ignore\n if (!isNil(attributes.radius)) {\n // @ts-ignore\n object.parsedStyle.radius = parseDimensionArrayFormat(\n // @ts-ignore\n attributes.radius, 4);\n }\n // Polyline\n if (!isNil(attributes.lineDash)) {\n object.parsedStyle.lineDash = parseDimensionArrayFormat(attributes.lineDash, 2);\n }\n // @ts-ignore\n if (attributes.points) {\n // @ts-ignore\n object.parsedStyle.points = parsePoints(attributes.points, object);\n }\n // Path\n // @ts-ignore\n if (attributes.path === '') {\n object.parsedStyle.path = __assign({}, EMPTY_PARSED_PATH);\n }\n // @ts-ignore\n if (attributes.path) {\n object.parsedStyle.path = parsePath(\n // @ts-ignore\n attributes.path);\n object.parsedStyle.defX = object.parsedStyle.path.rect.x;\n object.parsedStyle.defY = object.parsedStyle.path.rect.y;\n }\n // Text\n if (attributes.textTransform) {\n this.runtime.CSSPropertySyntaxFactory[''].calculator(null, null, { value: attributes.textTransform }, object, null);\n }\n if (attributes.clipPath) {\n this.runtime.CSSPropertySyntaxFactory[''].calculator('clipPath', oldClipPath, attributes.clipPath, object, this.runtime);\n }\n if (attributes.offsetPath) {\n this.runtime.CSSPropertySyntaxFactory[''].calculator('offsetPath', oldOffsetPath, attributes.offsetPath, object, this.runtime);\n }\n if (attributes.anchor) {\n object.parsedStyle.anchor = parseDimensionArrayFormat(\n // @ts-ignorex\n attributes.anchor, 2);\n }\n if (attributes.transform) {\n object.parsedStyle.transform = parseTransform(attributes.transform);\n }\n if (attributes.transformOrigin) {\n object.parsedStyle.transformOrigin = parseTransformOrigin(attributes.transformOrigin);\n }\n // Marker\n // @ts-ignore\n if (attributes.markerStart) {\n object.parsedStyle.markerStart = this.runtime.CSSPropertySyntaxFactory[''].calculator(null, \n // @ts-ignore\n attributes.markerStart, \n // @ts-ignore\n attributes.markerStart, null, null);\n }\n // @ts-ignore\n if (attributes.markerEnd) {\n object.parsedStyle.markerEnd = this.runtime.CSSPropertySyntaxFactory[''].calculator(null, \n // @ts-ignore\n attributes.markerEnd, \n // @ts-ignore\n attributes.markerEnd, null, null);\n }\n // @ts-ignore\n if (attributes.markerMid) {\n object.parsedStyle.markerMid = this.runtime.CSSPropertySyntaxFactory[''].calculator('', \n // @ts-ignore\n attributes.markerMid, \n // @ts-ignore\n attributes.markerMid, null, null);\n }\n if (\n // Circle & Ellipse\n ((object.nodeName === Shape.CIRCLE ||\n object.nodeName === Shape.ELLIPSE) &&\n // @ts-ignore\n (!isNil(attributes.cx) ||\n // @ts-ignore\n !isNil(attributes.cy))) ||\n ((object.nodeName === Shape.RECT ||\n object.nodeName === Shape.IMAGE ||\n object.nodeName === Shape.GROUP ||\n object.nodeName === Shape.HTML ||\n object.nodeName === Shape.TEXT ||\n object.nodeName === Shape.MESH) &&\n // @ts-ignore\n (!isNil(attributes.x) ||\n // @ts-ignore\n !isNil(attributes.y) ||\n // @ts-ignore\n !isNil(attributes.z))) ||\n // Line\n (object.nodeName === Shape.LINE &&\n // @ts-ignore\n (!isNil(attributes.x1) ||\n // @ts-ignore\n !isNil(attributes.y1) ||\n // @ts-ignore\n !isNil(attributes.z1) ||\n // @ts-ignore\n !isNil(attributes.x2) ||\n // @ts-ignore\n !isNil(attributes.y2) ||\n // @ts-ignore\n !isNil(attributes.z2)))) {\n this.runtime.CSSPropertySyntaxFactory[''].postProcessor(object, attributeNames_1);\n }\n if (!isNil(attributes.zIndex)) {\n this.runtime.CSSPropertySyntaxFactory[''].postProcessor(object, attributeNames_1);\n }\n // @ts-ignore\n if (attributes.path) {\n this.runtime.CSSPropertySyntaxFactory[''].postProcessor(object, attributeNames_1);\n }\n // @ts-ignore\n if (attributes.points) {\n this.runtime.CSSPropertySyntaxFactory[''].postProcessor(object, attributeNames_1);\n }\n if (!isNil(attributes.offsetDistance)) {\n this.runtime.CSSPropertySyntaxFactory[''].postProcessor(object, attributeNames_1);\n }\n if (attributes.transform) {\n this.runtime.CSSPropertySyntaxFactory[''].postProcessor(object, attributeNames_1);\n }\n if (needUpdateGeometry_1) {\n this.updateGeometry(object);\n }\n return;\n }\n var skipUpdateAttribute = options.skipUpdateAttribute, skipParse = options.skipParse, forceUpdateGeometry = options.forceUpdateGeometry, usedAttributes = options.usedAttributes, memoize = options.memoize;\n var needUpdateGeometry = forceUpdateGeometry;\n var attributeNames = Object.keys(attributes);\n attributeNames.forEach(function (attributeName) {\n var _a;\n if (!skipUpdateAttribute) {\n object.attributes[attributeName] = attributes[attributeName];\n }\n if (!needUpdateGeometry && ((_a = propertyMetadataCache[attributeName]) === null || _a === void 0 ? void 0 : _a.l)) {\n needUpdateGeometry = true;\n }\n });\n if (!skipParse) {\n attributeNames.forEach(function (name) {\n object.computedStyle[name] = _this.parseProperty(name, object.attributes[name], object, memoize);\n });\n }\n // let hasUnresolvedProperties = false;\n // parse according to priority\n // path 50\n // points 50\n // text 50\n // textTransform 51\n // anchor 99\n // transform 100\n // transformOrigin 100\n if (usedAttributes === null || usedAttributes === void 0 ? void 0 : usedAttributes.length) {\n // uniqueAttributeSet.clear();\n attributeNames = Array.from(new Set(attributeNames.concat(usedAttributes)));\n }\n // [\n // 'path',\n // 'points',\n // 'text',\n // 'textTransform',\n // 'anchor',\n // 'transform',\n // 'transformOrigin',\n // ].forEach((name) => {\n // const index = attributeNames.indexOf(name);\n // if (index > -1) {\n // attributeNames.splice(index, 1);\n // attributeNames.push(name);\n // }\n // });\n attributeNames.forEach(function (name) {\n // some style props maybe deleted after parsing such as `anchor` in Text\n if (name in object.computedStyle) {\n object.parsedStyle[name] = _this.computeProperty(name, object.computedStyle[name], object, memoize);\n }\n });\n // if (hasUnresolvedProperties) {\n // this.dirty = true;\n // return;\n // }\n // update geometry\n if (needUpdateGeometry) {\n // object.geometry.dirty = true;\n // runtime.sceneGraphService.dirtifyToRoot(object);\n this.updateGeometry(object);\n }\n attributeNames.forEach(function (name) {\n if (name in object.parsedStyle) {\n _this.postProcessProperty(name, object, attributeNames);\n }\n });\n if (this.runtime.enableCSSParsing && object.children.length) {\n attributeNames.forEach(function (name) {\n if (name in object.parsedStyle && _this.isPropertyInheritable(name)) {\n // update children's inheritable\n object.children.forEach(function (child) {\n child.internalSetAttribute(name, null, {\n skipUpdateAttribute: true,\n skipParse: true,\n });\n });\n }\n });\n }\n };\n /**\n * string -> parsed value\n */\n DefaultStyleValueRegistry.prototype.parseProperty = function (name, value, object, memoized) {\n var metadata = propertyMetadataCache[name];\n var computed = value;\n if (value === '' || isNil(value)) {\n value = 'unset';\n }\n if (value === 'unset' || value === 'initial' || value === 'inherit') {\n // computed = new CSSKeywordValue(value);\n computed = getOrCreateKeyword(value);\n }\n else {\n if (metadata) {\n var keywords = metadata.k, syntax = metadata.syntax;\n var handler = syntax && this.getPropertySyntax(syntax);\n // use keywords\n if (keywords && keywords.indexOf(value) > -1) {\n // computed = new CSSKeywordValue(value);\n computed = getOrCreateKeyword(value);\n }\n else if (handler) {\n if (!memoized && handler.parserUnmemoize) {\n computed = handler.parserUnmemoize(value, object);\n }\n else if (handler.parser) {\n // try to parse it to CSSStyleValue, eg. '10px' -> CSS.px(10)\n computed = handler.parser(value, object);\n }\n }\n }\n }\n return computed;\n };\n /**\n * computed value -> used value\n */\n DefaultStyleValueRegistry.prototype.computeProperty = function (name, computed, object, memoized) {\n var metadata = propertyMetadataCache[name];\n var isDocumentElement = object.id === 'g-root';\n // let used: CSSStyleValue = computed instanceof CSSStyleValue ? computed.clone() : computed;\n var used = computed;\n if (metadata) {\n var syntax = metadata.syntax, inherited = metadata.inh, defaultValue = metadata.d;\n if (computed instanceof CSSKeywordValue) {\n var value = computed.value;\n /**\n * @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/unset\n */\n if (value === 'unset') {\n if (inherited && !isDocumentElement) {\n value = 'inherit';\n }\n else {\n value = 'initial';\n }\n }\n if (value === 'initial') {\n // @see https://developer.mozilla.org/en-US/docs/Web/CSS/initial\n if (!isNil(defaultValue)) {\n computed = this.parseProperty(name, isFunction(defaultValue)\n ? defaultValue(object.nodeName)\n : defaultValue, object, memoized);\n }\n }\n else if (value === 'inherit') {\n // @see https://developer.mozilla.org/en-US/docs/Web/CSS/inherit\n // behave like `inherit`\n var resolved = this.tryToResolveProperty(object, name, {\n inherited: true,\n });\n if (!isNil(resolved)) {\n // object.parsedStyle[name] = resolved;\n // return false;\n return resolved;\n }\n else {\n this.addUnresolveProperty(object, name);\n return;\n }\n }\n }\n var handler = syntax && this.getPropertySyntax(syntax);\n if (handler && handler.calculator) {\n // convert computed value to used value\n var oldParsedValue = object.parsedStyle[name];\n used = handler.calculator(name, oldParsedValue, computed, object, this.runtime);\n }\n else if (computed instanceof CSSKeywordValue) {\n used = computed.value;\n }\n else {\n used = computed;\n }\n }\n // object.parsedStyle[name] = used;\n // return false;\n return used;\n };\n DefaultStyleValueRegistry.prototype.postProcessProperty = function (name, object, attributes) {\n var metadata = propertyMetadataCache[name];\n if (metadata && metadata.syntax) {\n var handler = metadata.syntax && this.getPropertySyntax(metadata.syntax);\n var propertyHandler = handler;\n if (propertyHandler && propertyHandler.postProcessor) {\n propertyHandler.postProcessor(object, attributes);\n }\n }\n };\n /**\n * resolve later\n */\n DefaultStyleValueRegistry.prototype.addUnresolveProperty = function (object, name) {\n var properties = unresolvedProperties.get(object);\n if (!properties) {\n unresolvedProperties.set(object, []);\n properties = unresolvedProperties.get(object);\n }\n if (properties.indexOf(name) === -1) {\n properties.push(name);\n }\n };\n DefaultStyleValueRegistry.prototype.tryToResolveProperty = function (object, name, options) {\n if (options === void 0) { options = {}; }\n var inherited = options.inherited;\n if (inherited) {\n if (object.parentElement &&\n isPropertyResolved(object.parentElement, name)) {\n // const computedValue = object.parentElement.computedStyle[name];\n var usedValue = object.parentElement.parsedStyle[name];\n if (\n // usedValue instanceof CSSKeywordValue &&\n usedValue === 'unset' ||\n usedValue === 'initial' ||\n usedValue === 'inherit') {\n return;\n }\n // else if (\n // usedValue instanceof CSSUnitValue &&\n // CSSUnitValue.isRelativeUnit(usedValue.unit)\n // ) {\n // return false;\n // }\n return usedValue;\n }\n }\n return;\n };\n DefaultStyleValueRegistry.prototype.recalc = function (object) {\n var properties = unresolvedProperties.get(object);\n if (properties && properties.length) {\n var attributes_1 = {};\n properties.forEach(function (property) {\n attributes_1[property] = object.attributes[property];\n });\n this.processProperties(object, attributes_1);\n unresolvedProperties.delete(object);\n }\n };\n /**\n * update geometry when relative props changed,\n * eg. r of Circle, width/height of Rect\n */\n DefaultStyleValueRegistry.prototype.updateGeometry = function (object) {\n var nodeName = object.nodeName;\n var geometryUpdater = this.runtime.geometryUpdaterFactory[nodeName];\n if (geometryUpdater) {\n var geometry_1 = object.geometry;\n if (!geometry_1.contentBounds) {\n geometry_1.contentBounds = new AABB();\n }\n if (!geometry_1.renderBounds) {\n geometry_1.renderBounds = new AABB();\n }\n var parsedStyle = object.parsedStyle;\n var _a = geometryUpdater.update(parsedStyle, object), width = _a.width, height = _a.height, _b = _a.depth, depth = _b === void 0 ? 0 : _b, _c = _a.offsetX, offsetX = _c === void 0 ? 0 : _c, _d = _a.offsetY, offsetY = _d === void 0 ? 0 : _d, _e = _a.offsetZ, offsetZ = _e === void 0 ? 0 : _e;\n // init with content box\n var halfExtents = [\n Math.abs(width) / 2,\n Math.abs(height) / 2,\n depth / 2,\n ];\n // const halfExtents = vec3.set(\n // tmpVec3a,\n // Math.abs(width) / 2,\n // Math.abs(height) / 2,\n // depth / 2,\n // );\n // anchor is center by default, don't account for lineWidth here\n var _f = parsedStyle, stroke = _f.stroke, lineWidth = _f.lineWidth, \n // lineCap,\n // lineJoin,\n // miterLimit,\n increasedLineWidthForHitTesting = _f.increasedLineWidthForHitTesting, shadowType = _f.shadowType, shadowColor = _f.shadowColor, _g = _f.filter, filter = _g === void 0 ? [] : _g, transformOrigin = _f.transformOrigin;\n var anchor = parsedStyle.anchor;\n // use textAlign & textBaseline instead of anchor\n if (nodeName === Shape.TEXT) {\n delete parsedStyle.anchor;\n }\n else if (nodeName === Shape.MESH) {\n parsedStyle.anchor[2] = 0.5;\n }\n var center = [\n ((1 - ((anchor && anchor[0]) || 0) * 2) * width) / 2 + offsetX,\n ((1 - ((anchor && anchor[1]) || 0) * 2) * height) / 2 + offsetY,\n (1 - ((anchor && anchor[2]) || 0) * 2) * halfExtents[2] + offsetZ,\n ];\n // const center = vec3.set(\n // tmpVec3b,\n // ((1 - ((anchor && anchor[0]) || 0) * 2) * width) / 2 + offsetX,\n // ((1 - ((anchor && anchor[1]) || 0) * 2) * height) / 2 + offsetY,\n // (1 - ((anchor && anchor[2]) || 0) * 2) * halfExtents[2] + offsetZ,\n // );\n // update geometry's AABB\n geometry_1.contentBounds.update(center, halfExtents);\n // @see https://github.molgen.mpg.de/git-mirror/cairo/blob/master/src/cairo-stroke-style.c#L97..L128\n var expansion = nodeName === Shape.POLYLINE ||\n nodeName === Shape.POLYGON ||\n nodeName === Shape.PATH\n ? Math.SQRT2\n : 0.5;\n // if (lineCap?.value === 'square') {\n // expansion = Math.SQRT1_2;\n // }\n // if (lineJoin?.value === 'miter' && expansion < Math.SQRT2 * miterLimit) {\n // expansion = Math.SQRT1_2 * miterLimit;\n // }\n // append border only if stroke existed\n var hasStroke = stroke && !stroke.isNone;\n if (hasStroke) {\n var halfLineWidth = ((lineWidth || 0) + (increasedLineWidthForHitTesting || 0)) *\n expansion;\n // halfExtents[0] += halfLineWidth[0];\n // halfExtents[1] += halfLineWidth[1];\n halfExtents[0] += halfLineWidth;\n halfExtents[1] += halfLineWidth;\n // vec3.add(\n // halfExtents,\n // halfExtents,\n // vec3.set(tmpVec3c, halfLineWidth, halfLineWidth, 0),\n // );\n }\n geometry_1.renderBounds.update(center, halfExtents);\n // account for shadow, only support constant value now\n if (shadowColor && shadowType && shadowType !== 'inner') {\n var _h = geometry_1.renderBounds, min = _h.min, max = _h.max;\n var _j = parsedStyle, shadowBlur = _j.shadowBlur, shadowOffsetX = _j.shadowOffsetX, shadowOffsetY = _j.shadowOffsetY;\n var shadowBlurInPixels = shadowBlur || 0;\n var shadowOffsetXInPixels = shadowOffsetX || 0;\n var shadowOffsetYInPixels = shadowOffsetY || 0;\n var shadowLeft = min[0] - shadowBlurInPixels + shadowOffsetXInPixels;\n var shadowRight = max[0] + shadowBlurInPixels + shadowOffsetXInPixels;\n var shadowTop = min[1] - shadowBlurInPixels + shadowOffsetYInPixels;\n var shadowBottom = max[1] + shadowBlurInPixels + shadowOffsetYInPixels;\n min[0] = Math.min(min[0], shadowLeft);\n max[0] = Math.max(max[0], shadowRight);\n min[1] = Math.min(min[1], shadowTop);\n max[1] = Math.max(max[1], shadowBottom);\n geometry_1.renderBounds.setMinMax(min, max);\n }\n // account for filter, eg. blur(5px), drop-shadow()\n filter.forEach(function (_a) {\n var name = _a.name, params = _a.params;\n if (name === 'blur') {\n var blurRadius = params[0].value;\n geometry_1.renderBounds.update(geometry_1.renderBounds.center, addVec3(geometry_1.renderBounds.halfExtents, geometry_1.renderBounds.halfExtents, [blurRadius, blurRadius, 0]));\n }\n else if (name === 'drop-shadow') {\n var shadowOffsetX = params[0].value;\n var shadowOffsetY = params[1].value;\n var shadowBlur = params[2].value;\n var _b = geometry_1.renderBounds, min = _b.min, max = _b.max;\n var shadowLeft = min[0] - shadowBlur + shadowOffsetX;\n var shadowRight = max[0] + shadowBlur + shadowOffsetX;\n var shadowTop = min[1] - shadowBlur + shadowOffsetY;\n var shadowBottom = max[1] + shadowBlur + shadowOffsetY;\n min[0] = Math.min(min[0], shadowLeft);\n max[0] = Math.max(max[0], shadowRight);\n min[1] = Math.min(min[1], shadowTop);\n max[1] = Math.max(max[1], shadowBottom);\n geometry_1.renderBounds.setMinMax(min, max);\n }\n });\n anchor = parsedStyle.anchor;\n // if (nodeName === Shape.RECT) {\n // account for negative width / height of Rect\n // @see https://github.com/antvis/g/issues/957\n var flipY = width < 0;\n var flipX = height < 0;\n // } else {\n // }\n // set transform origin\n var usedOriginXValue = (flipY ? -1 : 1) *\n (transformOrigin\n ? convertPercentUnit(transformOrigin[0], 0, object)\n : 0);\n var usedOriginYValue = (flipX ? -1 : 1) *\n (transformOrigin\n ? convertPercentUnit(transformOrigin[1], 1, object)\n : 0);\n usedOriginXValue =\n usedOriginXValue -\n (flipY ? -1 : 1) *\n ((anchor && anchor[0]) || 0) *\n geometry_1.contentBounds.halfExtents[0] *\n 2;\n usedOriginYValue =\n usedOriginYValue -\n (flipX ? -1 : 1) *\n ((anchor && anchor[1]) || 0) *\n geometry_1.contentBounds.halfExtents[1] *\n 2;\n object.setOrigin(usedOriginXValue, usedOriginYValue);\n // FIXME setOrigin may have already dirtified to root.\n this.runtime.sceneGraphService.dirtifyToRoot(object);\n }\n };\n DefaultStyleValueRegistry.prototype.isPropertyInheritable = function (name) {\n var metadata = propertyMetadataCache[name];\n if (!metadata) {\n return false;\n }\n return metadata.inh;\n };\n return DefaultStyleValueRegistry;\n}());\n\nvar CSSPropertyAngle = /** @class */ (function () {\n function CSSPropertyAngle() {\n this.parser = parseAngle;\n this.parserUnmemoize = parseAngleUnmemoize;\n this.parserWithCSSDisabled = null;\n this.mixer = mergeNumbers;\n }\n CSSPropertyAngle.prototype.calculator = function (name, oldParsed, parsed, object) {\n return convertAngleUnit(parsed);\n };\n return CSSPropertyAngle;\n}());\n\n/**\n * clipPath / textPath / offsetPath\n */\nvar CSSPropertyClipPath = /** @class */ (function () {\n function CSSPropertyClipPath() {\n }\n CSSPropertyClipPath.prototype.calculator = function (name, oldPath, newPath, object, runtime) {\n // unset\n if (newPath instanceof CSSKeywordValue) {\n newPath = null;\n }\n runtime.sceneGraphService.updateDisplayObjectDependency(name, oldPath, newPath, object);\n if (name === 'clipPath') {\n // should affect children\n object.forEach(function (leaf) {\n if (leaf.childNodes.length === 0) {\n runtime.sceneGraphService.dirtifyToRoot(leaf);\n }\n });\n }\n return newPath;\n };\n return CSSPropertyClipPath;\n}());\n\nvar CSSPropertyColor = /** @class */ (function () {\n function CSSPropertyColor() {\n this.parser = parseColor;\n this.parserWithCSSDisabled = parseColor;\n this.mixer = mergeColors;\n }\n CSSPropertyColor.prototype.calculator = function (name, oldParsed, parsed, object) {\n if (parsed instanceof CSSKeywordValue) {\n // 'unset' 'none'\n return parsed.value === 'none' ? noneColor : transparentColor;\n }\n return parsed;\n };\n return CSSPropertyColor;\n}());\n\nvar CSSPropertyFilter = /** @class */ (function () {\n function CSSPropertyFilter() {\n this.parser = parseFilter;\n }\n CSSPropertyFilter.prototype.calculator = function (name, oldParsed, parsed) {\n // unset or none\n if (parsed instanceof CSSKeywordValue) {\n return [];\n }\n return parsed;\n };\n return CSSPropertyFilter;\n}());\n\nfunction getFontSize(object) {\n var fontSize = object.parsedStyle.fontSize;\n return isNil(fontSize) ? null : fontSize;\n}\n/**\n * & \n */\nvar CSSPropertyLengthOrPercentage = /** @class */ (function () {\n function CSSPropertyLengthOrPercentage() {\n this.parser = parseLengthOrPercentage;\n this.parserUnmemoize = parseLengthOrPercentageUnmemoize;\n this.parserWithCSSDisabled = null;\n this.mixer = mergeNumbers;\n }\n /**\n * according to parent's bounds\n *\n * @example\n * CSS.percent(50) -> CSS.px(0.5 * parent.width)\n */\n CSSPropertyLengthOrPercentage.prototype.calculator = function (name, oldParsed, computed, object, runtime) {\n var _a;\n if (isNumber(computed)) {\n return computed;\n }\n if (CSSUnitValue.isRelativeUnit(computed.unit)) {\n var registry = runtime.styleValueRegistry;\n if (computed.unit === UnitType.kPercentage) {\n // TODO: merge dimensions\n return 0;\n }\n else if (computed.unit === UnitType.kEms) {\n if (object.parentNode) {\n var fontSize = getFontSize(object.parentNode);\n if (fontSize) {\n fontSize *= computed.value;\n return fontSize;\n }\n else {\n registry.addUnresolveProperty(object, name);\n }\n }\n else {\n registry.addUnresolveProperty(object, name);\n }\n return 0;\n }\n else if (computed.unit === UnitType.kRems) {\n if ((_a = object === null || object === void 0 ? void 0 : object.ownerDocument) === null || _a === void 0 ? void 0 : _a.documentElement) {\n var fontSize = getFontSize(object.ownerDocument.documentElement);\n if (fontSize) {\n fontSize *= computed.value;\n return fontSize;\n }\n else {\n registry.addUnresolveProperty(object, name);\n }\n }\n else {\n registry.addUnresolveProperty(object, name);\n }\n return 0;\n }\n }\n else {\n // remove listener if exists\n // registry.unregisterParentGeometryBoundsChangedHandler(object, name);\n // return absolute value\n return computed.value;\n }\n };\n return CSSPropertyLengthOrPercentage;\n}());\n\n/**\n * format to Tuple2\n *\n * @example\n * rect.style.lineDash = 10;\n * rect.style.lineDash = [10, 10];\n * rect.style.lineDash = '10 10';\n */\nvar CSSPropertyLengthOrPercentage12 = /** @class */ (function () {\n function CSSPropertyLengthOrPercentage12() {\n this.mixer = mergeNumberLists;\n }\n CSSPropertyLengthOrPercentage12.prototype.parser = function (radius) {\n var parsed = parseDimensionArray(isNumber(radius) ? [radius] : radius);\n var formatted;\n if (parsed.length === 1) {\n formatted = [parsed[0], parsed[0]];\n }\n else {\n formatted = [parsed[0], parsed[1]];\n }\n return formatted;\n };\n CSSPropertyLengthOrPercentage12.prototype.calculator = function (name, oldParsed, computed) {\n return computed.map(function (c) { return c.value; });\n };\n return CSSPropertyLengthOrPercentage12;\n}());\n\n/**\n * used in rounded rect\n *\n * @example\n * rect.style.radius = 10;\n * rect.style.radius = '10 10';\n * rect.style.radius = '10 10 10 10';\n */\nvar CSSPropertyLengthOrPercentage14 = /** @class */ (function () {\n function CSSPropertyLengthOrPercentage14() {\n this.mixer = mergeNumberLists;\n }\n CSSPropertyLengthOrPercentage14.prototype.parser = function (radius) {\n var parsed = parseDimensionArray(isNumber(radius) ? [radius] : radius);\n var formatted;\n // format to Tuple\n if (parsed.length === 1) {\n formatted = [parsed[0], parsed[0], parsed[0], parsed[0]];\n }\n else if (parsed.length === 2) {\n formatted = [parsed[0], parsed[1], parsed[0], parsed[1]];\n }\n else if (parsed.length === 3) {\n formatted = [parsed[0], parsed[1], parsed[2], parsed[1]];\n }\n else {\n formatted = [parsed[0], parsed[1], parsed[2], parsed[3]];\n }\n return formatted;\n };\n CSSPropertyLengthOrPercentage14.prototype.calculator = function (name, oldParsed, computed) {\n return computed.map(function (c) { return c.value; });\n };\n return CSSPropertyLengthOrPercentage14;\n}());\n\nvar tmpMat4 = mat4.create();\nfunction parsedTransformToMat4(transform, object) {\n var defX = object.parsedStyle.defX || 0;\n var defY = object.parsedStyle.defY || 0;\n // reset transform\n object.resetLocalTransform();\n object.setLocalPosition(defX, defY);\n transform.forEach(function (parsed) {\n var t = parsed.t, d = parsed.d;\n if (t === 'scale') {\n // scale(1) scale(1, 1)\n var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1, 1];\n object.scaleLocal(newScale[0], newScale[1], 1);\n }\n else if (t === 'scalex') {\n var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1];\n object.scaleLocal(newScale[0], 1, 1);\n }\n else if (t === 'scaley') {\n var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1];\n object.scaleLocal(1, newScale[0], 1);\n }\n else if (t === 'scalez') {\n var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1];\n object.scaleLocal(1, 1, newScale[0]);\n }\n else if (t === 'scale3d') {\n var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1, 1, 1];\n object.scaleLocal(newScale[0], newScale[1], newScale[2]);\n }\n else if (t === 'translate') {\n var newTranslation = d || [Opx, Opx];\n object.translateLocal(newTranslation[0].value, newTranslation[1].value, 0);\n }\n else if (t === 'translatex') {\n var newTranslation = d || [Opx];\n object.translateLocal(newTranslation[0].value, 0, 0);\n }\n else if (t === 'translatey') {\n var newTranslation = d || [Opx];\n object.translateLocal(0, newTranslation[0].value, 0);\n }\n else if (t === 'translatez') {\n var newTranslation = d || [Opx];\n object.translateLocal(0, 0, newTranslation[0].value);\n }\n else if (t === 'translate3d') {\n var newTranslation = d || [Opx, Opx, Opx];\n object.translateLocal(newTranslation[0].value, newTranslation[1].value, newTranslation[2].value);\n }\n else if (t === 'rotate') {\n var newAngles = d || [Odeg];\n object.rotateLocal(0, 0, convertAngleUnit(newAngles[0]));\n }\n else if (t === 'rotatex') {\n var newAngles = d || [Odeg];\n object.rotateLocal(convertAngleUnit(newAngles[0]), 0, 0);\n }\n else if (t === 'rotatey') {\n var newAngles = d || [Odeg];\n object.rotateLocal(0, convertAngleUnit(newAngles[0]), 0);\n }\n else if (t === 'rotatez') {\n var newAngles = d || [Odeg];\n object.rotateLocal(0, 0, convertAngleUnit(newAngles[0]));\n }\n else if (t === 'rotate3d') ;\n else if (t === 'skew') {\n var newSkew = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [0, 0];\n object.setLocalSkew(deg2rad(newSkew[0]), deg2rad(newSkew[1]));\n }\n else if (t === 'skewx') {\n var newSkew = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [0];\n object.setLocalSkew(deg2rad(newSkew[0]), object.getLocalSkew()[1]);\n }\n else if (t === 'skewy') {\n var newSkew = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [0];\n object.setLocalSkew(object.getLocalSkew()[0], deg2rad(newSkew[0]));\n }\n else if (t === 'matrix') {\n var _a = __read(d.map(function (s) { return s.value; }), 6), a = _a[0], b = _a[1], c = _a[2], dd = _a[3], tx = _a[4], ty = _a[5];\n object.setLocalTransform(mat4.set(tmpMat4, a, b, 0, 0, c, dd, 0, 0, 0, 0, 1, 0, tx + defX, ty + defY, 0, 1));\n }\n else if (t === 'matrix3d') {\n // @ts-ignore\n mat4.set.apply(mat4, __spreadArray([tmpMat4], __read(d.map(function (s) { return s.value; })), false));\n tmpMat4[12] += defX;\n tmpMat4[13] += defY;\n object.setLocalTransform(tmpMat4);\n }\n });\n return object.getLocalTransform();\n}\n\n/**\n * local position\n */\nvar CSSPropertyLocalPosition = /** @class */ (function (_super) {\n __extends(CSSPropertyLocalPosition, _super);\n function CSSPropertyLocalPosition() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * update local position\n */\n CSSPropertyLocalPosition.prototype.postProcessor = function (object, attributes) {\n var x;\n var y;\n var z;\n switch (object.nodeName) {\n case Shape.CIRCLE:\n case Shape.ELLIPSE:\n var _a = object.parsedStyle, cx = _a.cx, cy = _a.cy, cz = _a.cz;\n if (!isNil(cx)) {\n x = cx;\n }\n if (!isNil(cy)) {\n y = cy;\n }\n if (!isNil(cz)) {\n z = cz;\n }\n break;\n case Shape.LINE:\n var _b = object.parsedStyle, x1 = _b.x1, x2 = _b.x2, y1 = _b.y1, y2 = _b.y2;\n var minX = Math.min(x1, x2);\n var minY = Math.min(y1, y2);\n x = minX;\n y = minY;\n z = 0;\n break;\n case Shape.RECT:\n case Shape.IMAGE:\n case Shape.GROUP:\n case Shape.HTML:\n case Shape.TEXT:\n case Shape.MESH:\n if (!isNil(object.parsedStyle.x)) {\n x = object.parsedStyle.x;\n }\n if (!isNil(object.parsedStyle.y)) {\n y = object.parsedStyle.y;\n }\n if (!isNil(object.parsedStyle.z)) {\n z = object.parsedStyle.z;\n }\n break;\n }\n if (object.nodeName !== Shape.PATH &&\n object.nodeName !== Shape.POLYLINE &&\n object.nodeName !== Shape.POLYGON) {\n object.parsedStyle.defX = x || 0;\n object.parsedStyle.defY = y || 0;\n }\n var needResetLocalPosition = !isNil(x) || !isNil(y) || !isNil(z);\n // only if `transform` won't be processed later\n if (needResetLocalPosition && attributes.indexOf('transform') === -1) {\n // account for current transform if needed\n var transform = object.parsedStyle.transform;\n if (transform && transform.length) {\n parsedTransformToMat4(transform, object);\n }\n else {\n var _c = __read(object.getLocalPosition(), 3), ox = _c[0], oy = _c[1], oz = _c[2];\n object.setLocalPosition(isNil(x) ? ox : x, isNil(y) ? oy : y, isNil(z) ? oz : z);\n }\n }\n };\n return CSSPropertyLocalPosition;\n}(CSSPropertyLengthOrPercentage));\n\nvar CSSPropertyMarker = /** @class */ (function () {\n function CSSPropertyMarker() {\n }\n CSSPropertyMarker.prototype.calculator = function (name, oldMarker, newMarker, object) {\n // unset\n if (newMarker instanceof CSSKeywordValue) {\n newMarker = null;\n }\n var cloned = newMarker === null || newMarker === void 0 ? void 0 : newMarker.cloneNode(true);\n if (cloned) {\n // FIXME: SVG should not inherit parent's style, add a flag here\n cloned.style.isMarker = true;\n }\n return cloned;\n };\n return CSSPropertyMarker;\n}());\n\nvar CSSPropertyNumber = /** @class */ (function () {\n function CSSPropertyNumber() {\n this.mixer = mergeNumbers;\n this.parser = parseNumber;\n this.parserUnmemoize = parseNumberUnmemoize;\n this.parserWithCSSDisabled = null;\n }\n CSSPropertyNumber.prototype.calculator = function (name, oldParsed, computed) {\n return computed.value;\n };\n return CSSPropertyNumber;\n}());\n\nvar CSSPropertyOffsetDistance = /** @class */ (function () {\n function CSSPropertyOffsetDistance() {\n this.parser = parseNumber;\n this.parserUnmemoize = parseNumberUnmemoize;\n this.parserWithCSSDisabled = null;\n this.mixer = clampedMergeNumbers(0, 1);\n }\n CSSPropertyOffsetDistance.prototype.calculator = function (name, oldParsed, computed) {\n return computed.value;\n };\n CSSPropertyOffsetDistance.prototype.postProcessor = function (object) {\n var _a = object.parsedStyle, offsetPath = _a.offsetPath, offsetDistance = _a.offsetDistance;\n if (!offsetPath) {\n return;\n }\n var nodeName = offsetPath.nodeName;\n if (nodeName === Shape.LINE ||\n nodeName === Shape.PATH ||\n nodeName === Shape.POLYLINE) {\n // set position in world space\n var point = offsetPath.getPoint(offsetDistance);\n if (point) {\n object.parsedStyle.defX = point.x;\n object.parsedStyle.defY = point.y;\n object.setLocalPosition(point.x, point.y);\n }\n }\n };\n return CSSPropertyOffsetDistance;\n}());\n\n/**\n * opacity\n */\nvar CSSPropertyOpacity = /** @class */ (function () {\n function CSSPropertyOpacity() {\n this.parser = parseNumber;\n this.parserUnmemoize = parseNumberUnmemoize;\n this.parserWithCSSDisabled = null;\n this.mixer = clampedMergeNumbers(0, 1);\n }\n CSSPropertyOpacity.prototype.calculator = function (name, oldParsed, computed) {\n return computed.value;\n };\n return CSSPropertyOpacity;\n}());\n\nvar CSSPropertyPath = /** @class */ (function () {\n function CSSPropertyPath() {\n /**\n * path2Curve\n */\n this.parser = parsePath;\n this.parserWithCSSDisabled = parsePath;\n this.mixer = mergePaths;\n }\n CSSPropertyPath.prototype.calculator = function (name, oldParsed, parsed) {\n // unset\n if (parsed instanceof CSSKeywordValue && parsed.value === 'unset') {\n return {\n absolutePath: [],\n hasArc: false,\n segments: [],\n polygons: [],\n polylines: [],\n curve: null,\n totalLength: 0,\n rect: new Rectangle(0, 0, 0, 0),\n };\n }\n return parsed;\n };\n /**\n * update local position\n */\n CSSPropertyPath.prototype.postProcessor = function (object, attributes) {\n object.parsedStyle.defX = object.parsedStyle.path.rect.x;\n object.parsedStyle.defY = object.parsedStyle.path.rect.y;\n if (object.nodeName === Shape.PATH &&\n attributes.indexOf('transform') === -1) {\n var _a = object.parsedStyle, _b = _a.defX, defX = _b === void 0 ? 0 : _b, _c = _a.defY, defY = _c === void 0 ? 0 : _c;\n object.setLocalPosition(defX, defY);\n }\n };\n return CSSPropertyPath;\n}());\n\nvar CSSPropertyPoints = /** @class */ (function () {\n function CSSPropertyPoints() {\n this.parser = parsePoints;\n this.mixer = mergePoints;\n }\n /**\n * update local position\n */\n CSSPropertyPoints.prototype.postProcessor = function (object, attributes) {\n if ((object.nodeName === Shape.POLYGON ||\n object.nodeName === Shape.POLYLINE) &&\n attributes.indexOf('transform') === -1) {\n var _a = object.parsedStyle, defX = _a.defX, defY = _a.defY;\n object.setLocalPosition(defX, defY);\n }\n };\n return CSSPropertyPoints;\n}());\n\nvar CSSPropertyShadowBlur = /** @class */ (function (_super) {\n __extends(CSSPropertyShadowBlur, _super);\n function CSSPropertyShadowBlur() {\n var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;\n _this.mixer = clampedMergeNumbers(0, Infinity);\n return _this;\n }\n return CSSPropertyShadowBlur;\n}(CSSPropertyLengthOrPercentage));\n\nvar CSSPropertyText = /** @class */ (function () {\n function CSSPropertyText() {\n }\n CSSPropertyText.prototype.calculator = function (name, oldParsed, parsed, object) {\n if (parsed instanceof CSSKeywordValue) {\n if (parsed.value === 'unset') {\n return '';\n }\n else {\n return parsed.value;\n }\n }\n // allow number as valid text content\n return \"\".concat(parsed);\n };\n CSSPropertyText.prototype.postProcessor = function (object) {\n object.nodeValue = \"\".concat(object.parsedStyle.text) || '';\n };\n return CSSPropertyText;\n}());\n\n/**\n * it must transform after text get parsed\n * @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/text-transform\n */\nvar CSSPropertyTextTransform = /** @class */ (function () {\n function CSSPropertyTextTransform() {\n }\n CSSPropertyTextTransform.prototype.calculator = function (name, oldParsed, parsed, object) {\n var rawText = object.getAttribute('text');\n if (rawText) {\n var transformedText = rawText;\n if (parsed.value === 'capitalize') {\n transformedText = rawText.charAt(0).toUpperCase() + rawText.slice(1);\n }\n else if (parsed.value === 'lowercase') {\n transformedText = rawText.toLowerCase();\n }\n else if (parsed.value === 'uppercase') {\n transformedText = rawText.toUpperCase();\n }\n object.parsedStyle.text = transformedText;\n }\n return parsed.value;\n };\n return CSSPropertyTextTransform;\n}());\n\nvar canvasMap = {};\nvar defaultCanvasIdCounter = 0;\n/**\n * destroy existed canvas with the same id\n */\nfunction cleanExistedCanvas(container, canvas) {\n if (container) {\n var id = typeof container === 'string'\n ? container\n : container.id || defaultCanvasIdCounter++;\n if (canvasMap[id]) {\n canvasMap[id].destroy();\n }\n canvasMap[id] = canvas;\n }\n}\nvar isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';\n\nfunction isElement(target) {\n return !!target.getAttribute;\n}\nfunction sortedIndex(array, value) {\n var low = 0;\n var high = array.length;\n while (low < high) {\n var mid = (low + high) >>> 1;\n if (sortByZIndex(array[mid], value) < 0) {\n low = mid + 1;\n }\n else {\n high = mid;\n }\n }\n return low;\n}\nfunction sortByZIndex(o1, o2) {\n var zIndex1 = Number(o1.parsedStyle.zIndex);\n var zIndex2 = Number(o2.parsedStyle.zIndex);\n if (zIndex1 === zIndex2) {\n var parent_1 = o1.parentNode;\n if (parent_1) {\n var children = parent_1.childNodes || [];\n return children.indexOf(o1) - children.indexOf(o2);\n }\n }\n return zIndex1 - zIndex2;\n}\nfunction findClosestClipPathTarget(object) {\n var _a;\n var el = object;\n do {\n var clipPath = (_a = el.parsedStyle) === null || _a === void 0 ? void 0 : _a.clipPath;\n if (clipPath)\n return el;\n el = el.parentElement;\n } while (el !== null);\n return null;\n}\nvar PX_SUFFIX = 'px';\nfunction setDOMSize($el, width, height) {\n if (isBrowser && $el.style) {\n $el.style.width = width + PX_SUFFIX;\n $el.style.height = height + PX_SUFFIX;\n }\n}\nfunction getStyle($el, property) {\n if (isBrowser) {\n return document.defaultView\n .getComputedStyle($el, null)\n .getPropertyValue(property);\n }\n}\nfunction getWidth($el) {\n var width = getStyle($el, 'width');\n if (width === 'auto') {\n return $el.offsetWidth;\n }\n return parseFloat(width);\n}\nfunction getHeight($el) {\n var height = getStyle($el, 'height');\n if (height === 'auto') {\n return $el.offsetHeight;\n }\n return parseFloat(height);\n}\n\n// borrow from hammer.js\nvar MOUSE_POINTER_ID = 1;\nvar TOUCH_TO_POINTER = {\n touchstart: 'pointerdown',\n touchend: 'pointerup',\n touchendoutside: 'pointerupoutside',\n touchmove: 'pointermove',\n touchcancel: 'pointercancel',\n};\nvar clock = typeof performance === 'object' && performance.now ? performance : Date;\n\nfunction isFillOrStrokeAffected(pointerEvents, fill, stroke) {\n // account for pointerEvents\n // @see https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events\n var hasFill = false;\n var hasStroke = false;\n var isFillOtherThanNone = !!fill && !fill.isNone;\n var isStrokeOtherThanNone = !!stroke && !stroke.isNone;\n if (pointerEvents === 'visiblepainted' ||\n pointerEvents === 'painted' ||\n pointerEvents === 'auto') {\n hasFill = isFillOtherThanNone;\n hasStroke = isStrokeOtherThanNone;\n }\n else if (pointerEvents === 'visiblefill' || pointerEvents === 'fill') {\n hasFill = true;\n }\n else if (pointerEvents === 'visiblestroke' || pointerEvents === 'stroke') {\n hasStroke = true;\n }\n else if (pointerEvents === 'visible' || pointerEvents === 'all') {\n // The values of the fill and stroke do not affect event processing.\n hasFill = true;\n hasStroke = true;\n }\n return [hasFill, hasStroke];\n}\n\n/**\n * Thanks for following contributor of codes\n * https://gist.github.com/1866474\n * http://paulirish.com/2011/requestanimationframe-for-smart-animating/\n * http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating\n * https://github.com/Financial-Times/polyfill-library/blob/master/polyfills/requestAnimationFrame/polyfill.js\n **/\nvar uId = 1;\nvar uniqueId = function () { return uId++; };\n// We use `self` instead of `window` for `WebWorker` support.\nvar root = typeof self === 'object' && self.self == self\n ? self\n : // @ts-ignore\n typeof global === 'object' && global.global == global\n ? // @ts-ignore\n global\n : {};\nvar nowOffset = Date.now();\n// use performance api if exist, otherwise use Date.now.\n// Date.now polyfill required.\nvar pnow = function () {\n if (root.performance && typeof root.performance.now === 'function') {\n return root.performance.now();\n }\n // fallback\n return Date.now() - nowOffset;\n};\nvar reservedCBs = {};\nvar lastTime = Date.now();\nvar polyfillRaf = function (callback) {\n if (typeof callback !== 'function') {\n throw new TypeError(callback + ' is not a function');\n }\n var currentTime = Date.now();\n var gap = currentTime - lastTime;\n var delay = gap > 16 ? 0 : 16 - gap;\n var id = uniqueId();\n reservedCBs[id] = callback;\n // keys(reservedCBs).length > 1 의미는 이미 setTimeout 이 걸려있는 경우.\n // 함께 callback 이 실행될 수 있게 reservedCBs 에만 추가해주고 return\n if (Object.keys(reservedCBs).length > 1)\n return id;\n setTimeout(function () {\n lastTime = currentTime;\n var copied = reservedCBs;\n reservedCBs = {};\n Object.keys(copied).forEach(function (key) { return copied[key](pnow()); });\n }, delay);\n return id;\n};\nvar polyfillCaf = function (id) {\n delete reservedCBs[id];\n};\nvar vendorPrefixes = ['', 'webkit', 'moz', 'ms', 'o'];\nvar getRequestAnimationFrame = function (vp) {\n if (typeof vp !== 'string')\n return polyfillRaf;\n if (vp === '')\n return root['requestAnimationFrame'];\n return root[vp + 'RequestAnimationFrame'];\n};\nvar getCancelAnimationFrame = function (vp) {\n if (typeof vp !== 'string')\n return polyfillCaf;\n if (vp === '')\n return root['cancelAnimationFrame'];\n return (root[vp + 'CancelAnimationFrame'] ||\n root[vp + 'CancelRequestAnimationFrame']);\n};\nvar find = function (arr, predicate) {\n var i = 0;\n while (arr[i] !== void 0) {\n if (predicate(arr[i]))\n return arr[i];\n i = i + 1;\n }\n};\nvar vp = find(vendorPrefixes, function (vp) { return !!getRequestAnimationFrame(vp); });\nvar raf = getRequestAnimationFrame(vp);\nvar caf = getCancelAnimationFrame(vp);\nroot.requestAnimationFrame = raf;\nroot.cancelAnimationFrame = caf;\n\nvar AsyncParallelHook = /** @class */ (function () {\n function AsyncParallelHook() {\n this.callbacks = [];\n }\n AsyncParallelHook.prototype.getCallbacksNum = function () {\n return this.callbacks.length;\n };\n AsyncParallelHook.prototype.tapPromise = function (options, fn) {\n this.callbacks.push(fn);\n };\n AsyncParallelHook.prototype.promise = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return Promise.all(this.callbacks.map(function (callback) {\n return callback.apply(void 0, __spreadArray([], __read(args), false));\n }));\n };\n return AsyncParallelHook;\n}());\n\nvar AsyncSeriesWaterfallHook = /** @class */ (function () {\n function AsyncSeriesWaterfallHook() {\n this.callbacks = [];\n }\n AsyncSeriesWaterfallHook.prototype.tapPromise = function (options, fn) {\n this.callbacks.push(fn);\n };\n AsyncSeriesWaterfallHook.prototype.promise = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return __awaiter(this, void 0, void 0, function () {\n var result, i, callback;\n var _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (!this.callbacks.length) return [3 /*break*/, 6];\n return [4 /*yield*/, (_a = this.callbacks)[0].apply(_a, __spreadArray([], __read(args), false))];\n case 1:\n result = _b.sent();\n i = 0;\n _b.label = 2;\n case 2:\n if (!(i < this.callbacks.length - 1)) return [3 /*break*/, 5];\n callback = this.callbacks[i];\n return [4 /*yield*/, callback(result)];\n case 3:\n // @ts-ignore\n result = _b.sent();\n _b.label = 4;\n case 4:\n i++;\n return [3 /*break*/, 2];\n case 5: return [2 /*return*/, result];\n case 6: return [2 /*return*/, null];\n }\n });\n });\n };\n return AsyncSeriesWaterfallHook;\n}());\n\nvar SyncHook = /** @class */ (function () {\n function SyncHook() {\n this.callbacks = [];\n }\n SyncHook.prototype.tap = function (options, fn) {\n this.callbacks.push(fn);\n };\n SyncHook.prototype.call = function () {\n /* eslint-disable-next-line prefer-rest-params */\n var argsArr = arguments;\n this.callbacks.forEach(function (callback) {\n /* eslint-disable-next-line prefer-spread */\n callback.apply(void 0, argsArr);\n });\n };\n return SyncHook;\n}());\n\nvar SyncWaterfallHook = /** @class */ (function () {\n function SyncWaterfallHook() {\n this.callbacks = [];\n }\n SyncWaterfallHook.prototype.tap = function (options, fn) {\n this.callbacks.push(fn);\n };\n SyncWaterfallHook.prototype.call = function () {\n if (this.callbacks.length) {\n /* eslint-disable-next-line prefer-rest-params */\n var argsArr = arguments;\n /* eslint-disable-next-line prefer-spread */\n var result = this.callbacks[0].apply(void 0, argsArr);\n for (var i = 0; i < this.callbacks.length - 1; i++) {\n var callback = this.callbacks[i];\n // @ts-ignore\n result = callback(result);\n }\n return result;\n }\n return null;\n };\n return SyncWaterfallHook;\n}());\n\nvar genericFontFamilies = [\n 'serif',\n 'sans-serif',\n 'monospace',\n 'cursive',\n 'fantasy',\n 'system-ui',\n];\nvar stringRegExp = /([\\\"\\'])[^\\'\\\"]+\\1/;\nfunction toFontString(attributes) {\n var fontSize = attributes.fontSize, fontFamily = attributes.fontFamily, fontStyle = attributes.fontStyle, fontVariant = attributes.fontVariant, fontWeight = attributes.fontWeight;\n // build canvas api font setting from individual components. Convert a numeric this.fontSize to px\n // const fontSizeString: string = isNumber(fontSize) ? `${fontSize}px` : fontSize.toString();\n var fontSizeString = (isNumber(fontSize) && \"\".concat(fontSize, \"px\")) || '16px';\n // Clean-up fontFamily property by quoting each font name\n // this will support font names with spaces\n var fontFamilies = fontFamily.split(',');\n for (var i = fontFamilies.length - 1; i >= 0; i--) {\n // Trim any extra white-space\n var fontFamily_1 = fontFamilies[i].trim();\n // Check if font already contains strings\n if (!stringRegExp.test(fontFamily_1) &&\n genericFontFamilies.indexOf(fontFamily_1) < 0) {\n fontFamily_1 = \"\\\"\".concat(fontFamily_1, \"\\\"\");\n }\n fontFamilies[i] = fontFamily_1;\n }\n return \"\".concat(fontStyle, \" \").concat(fontVariant, \" \").concat(fontWeight, \" \").concat(fontSizeString, \" \").concat(fontFamilies.join(','));\n}\n\n/**\n * @see /zh/docs/api/animation#支持变换的属性\n *\n * support the following formats like CSS Transform:\n *\n * scale\n * * scale(x, y)\n * * scaleX(x)\n * * scaleY(x)\n * * scaleZ(z)\n * * scale3d(x, y, z)\n *\n * translate (unit: none, px, %(relative to its bounds))\n * * translate(x, y) eg. translate(0, 0) translate(0, 30px) translate(100%, 100%)\n * * translateX(0)\n * * translateY(0)\n * * translateZ(0)\n * * translate3d(0, 0, 0)\n *\n * rotate (unit: deg rad turn)\n * * rotate(0.5turn) rotate(30deg) rotate(1rad)\n *\n * none\n *\n * unsupported for now:\n * * calc() eg. translate(calc(100% + 10px))\n * * matrix/matrix3d()\n * * skew/skewX/skewY\n * * perspective\n */\nvar CSSPropertyTransform = /** @class */ (function () {\n function CSSPropertyTransform() {\n this.parser = parseTransform;\n this.parserUnmemoize = parseTransformUnmemoize;\n this.parserWithCSSDisabled = parseTransformUnmemoize;\n this.mixer = mergeTransforms;\n }\n CSSPropertyTransform.prototype.calculator = function (name, oldParsed, parsed, object) {\n // 'none'\n if (parsed instanceof CSSKeywordValue) {\n return [];\n }\n return parsed;\n };\n CSSPropertyTransform.prototype.postProcessor = function (object) {\n var transform = object.parsedStyle.transform;\n parsedTransformToMat4(transform, object);\n };\n return CSSPropertyTransform;\n}());\n\n/**\n * @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/transform-origin\n * @example\n * [10px, 10px] [10%, 10%]\n */\nvar CSSPropertyTransformOrigin = /** @class */ (function () {\n function CSSPropertyTransformOrigin() {\n this.parser = parseTransformOrigin;\n this.parserUnmemoize = parseTransformOriginUnmemoize;\n // calculator(\n // name: string,\n // oldParsed: [CSSUnitValue, CSSUnitValue],\n // parsed: [CSSUnitValue, CSSUnitValue],\n // object: DisplayObject,\n // ): [number, number] {\n // console.log(object, parsed);\n // return [parsed[0].value, parsed[1].value];\n // // return [convertPercentUnit(parsed[0], 0, object), convertPercentUnit(parsed[1], 1, object)];\n // }\n }\n return CSSPropertyTransformOrigin;\n}());\n\nvar CSSPropertyZIndex = /** @class */ (function () {\n function CSSPropertyZIndex() {\n this.parser = parseNumber;\n this.parserUnmemoize = parseNumberUnmemoize;\n }\n CSSPropertyZIndex.prototype.calculator = function (name, oldParsed, computed, object) {\n return computed.value;\n };\n CSSPropertyZIndex.prototype.postProcessor = function (object) {\n if (object.parentNode) {\n var parentEntity = object.parentNode;\n var parentRenderable = parentEntity.renderable;\n var parentSortable = parentEntity.sortable;\n if (parentRenderable) {\n parentRenderable.dirty = true;\n }\n // need re-sort on parent\n if (parentSortable) {\n parentSortable.dirty = true;\n parentSortable.dirtyReason = SortReason.Z_INDEX_CHANGED;\n }\n }\n };\n return CSSPropertyZIndex;\n}());\n\nvar CircleUpdater = /** @class */ (function () {\n function CircleUpdater() {\n }\n CircleUpdater.prototype.update = function (parsedStyle, object) {\n var r = parsedStyle.r;\n var width = r * 2;\n var height = r * 2;\n return {\n width: width,\n height: height,\n };\n };\n return CircleUpdater;\n}());\n\nvar EllipseUpdater = /** @class */ (function () {\n function EllipseUpdater() {\n }\n EllipseUpdater.prototype.update = function (parsedStyle, object) {\n var rx = parsedStyle.rx, ry = parsedStyle.ry;\n var width = rx * 2;\n var height = ry * 2;\n return {\n width: width,\n height: height,\n };\n };\n return EllipseUpdater;\n}());\n\nvar LineUpdater = /** @class */ (function () {\n function LineUpdater() {\n }\n LineUpdater.prototype.update = function (parsedStyle) {\n var x1 = parsedStyle.x1, y1 = parsedStyle.y1, x2 = parsedStyle.x2, y2 = parsedStyle.y2;\n var minX = Math.min(x1, x2);\n var maxX = Math.max(x1, x2);\n var minY = Math.min(y1, y2);\n var maxY = Math.max(y1, y2);\n var width = maxX - minX;\n var height = maxY - minY;\n return {\n width: width,\n height: height,\n };\n };\n return LineUpdater;\n}());\n\nvar PathUpdater = /** @class */ (function () {\n function PathUpdater() {\n }\n PathUpdater.prototype.update = function (parsedStyle) {\n var path = parsedStyle.path;\n var _a = path.rect, width = _a.width, height = _a.height;\n return {\n width: width,\n height: height,\n };\n };\n return PathUpdater;\n}());\n\nvar PolylineUpdater = /** @class */ (function () {\n function PolylineUpdater() {\n }\n PolylineUpdater.prototype.update = function (parsedStyle) {\n if (parsedStyle.points && isArray(parsedStyle.points.points)) {\n var points = parsedStyle.points.points;\n // FIXME: account for miter lineJoin\n var minX = Math.min.apply(Math, __spreadArray([], __read(points.map(function (point) { return point[0]; })), false));\n var maxX = Math.max.apply(Math, __spreadArray([], __read(points.map(function (point) { return point[0]; })), false));\n var minY = Math.min.apply(Math, __spreadArray([], __read(points.map(function (point) { return point[1]; })), false));\n var maxY = Math.max.apply(Math, __spreadArray([], __read(points.map(function (point) { return point[1]; })), false));\n var width = maxX - minX;\n var height = maxY - minY;\n return {\n width: width,\n height: height,\n };\n }\n return {\n width: 0,\n height: 0,\n };\n };\n return PolylineUpdater;\n}());\n\nvar RectUpdater = /** @class */ (function () {\n function RectUpdater() {\n }\n RectUpdater.prototype.update = function (parsedStyle, object) {\n var img = parsedStyle.img, _a = parsedStyle.width, width = _a === void 0 ? 0 : _a, _b = parsedStyle.height, height = _b === void 0 ? 0 : _b;\n var contentWidth = width;\n var contentHeight = height;\n // resize with HTMLImageElement's size\n if (img && !isString(img)) {\n if (!contentWidth) {\n contentWidth = img.width;\n parsedStyle.width = contentWidth;\n }\n if (!contentHeight) {\n contentHeight = img.height;\n parsedStyle.height = contentHeight;\n }\n }\n return {\n width: contentWidth,\n height: contentHeight,\n };\n };\n return RectUpdater;\n}());\n\nvar TextUpdater = /** @class */ (function () {\n function TextUpdater(globalRuntime) {\n this.globalRuntime = globalRuntime;\n }\n TextUpdater.prototype.isReadyToMeasure = function (parsedStyle, object) {\n var text = parsedStyle.text, textAlign = parsedStyle.textAlign, textBaseline = parsedStyle.textBaseline, fontSize = parsedStyle.fontSize, fontStyle = parsedStyle.fontStyle, fontWeight = parsedStyle.fontWeight, fontVariant = parsedStyle.fontVariant, lineWidth = parsedStyle.lineWidth;\n return (text &&\n fontSize &&\n fontStyle &&\n fontWeight &&\n fontVariant &&\n textAlign &&\n textBaseline &&\n !isNil(lineWidth));\n };\n TextUpdater.prototype.update = function (parsedStyle, object) {\n var _a, _b;\n var text = parsedStyle.text, textAlign = parsedStyle.textAlign, lineWidth = parsedStyle.lineWidth, textBaseline = parsedStyle.textBaseline, dx = parsedStyle.dx, dy = parsedStyle.dy;\n if (!this.isReadyToMeasure(parsedStyle, object)) {\n parsedStyle.metrics = {\n font: '',\n width: 0,\n height: 0,\n lines: [],\n lineWidths: [],\n lineHeight: 0,\n maxLineWidth: 0,\n fontProperties: {\n ascent: 0,\n descent: 0,\n fontSize: 0,\n },\n lineMetrics: [],\n };\n return {\n width: 0,\n height: 0,\n x: 0,\n y: 0,\n offsetX: 0,\n offsetY: 0,\n };\n }\n var offscreenCanvas = (((_b = (_a = object === null || object === void 0 ? void 0 : object.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView) === null || _b === void 0 ? void 0 : _b.getConfig()) || {}).offscreenCanvas;\n var metrics = this.globalRuntime.textService.measureText(text, parsedStyle, offscreenCanvas);\n parsedStyle.metrics = metrics;\n var width = metrics.width, height = metrics.height, lineHeight = metrics.lineHeight, fontProperties = metrics.fontProperties;\n // anchor is left-top by default\n var halfExtents = [width / 2, height / 2, 0];\n // default 'left'\n var anchor = [0, 1];\n var lineXOffset = 0;\n if (textAlign === 'center' || textAlign === 'middle') {\n lineXOffset = lineWidth / 2;\n anchor = [0.5, 1];\n }\n else if (textAlign === 'right' || textAlign === 'end') {\n lineXOffset = lineWidth;\n anchor = [1, 1];\n }\n var lineYOffset = 0;\n if (textBaseline === 'middle') {\n // eslint-disable-next-line prefer-destructuring\n lineYOffset = halfExtents[1];\n }\n else if (textBaseline === 'top' || textBaseline === 'hanging') {\n lineYOffset = halfExtents[1] * 2;\n }\n else if (textBaseline === 'alphabetic') {\n // prevent calling getImageData for ascent metrics\n lineYOffset = this.globalRuntime.enableCSSParsing\n ? lineHeight - fontProperties.ascent\n : 0;\n }\n else if (textBaseline === 'bottom' || textBaseline === 'ideographic') {\n lineYOffset = 0;\n }\n // TODO: ideographic & bottom\n if (dx) {\n lineXOffset += dx;\n }\n if (dy) {\n lineYOffset += dy;\n }\n // update anchor\n parsedStyle.anchor = [anchor[0], anchor[1], 0];\n return {\n width: halfExtents[0] * 2,\n height: halfExtents[1] * 2,\n offsetX: lineXOffset,\n offsetY: lineYOffset,\n };\n };\n return TextUpdater;\n}());\n\nfunction isFederatedEvent(value) {\n return !!value.type;\n}\n/**\n * An DOM-compatible synthetic event implementation that is \"forwarded\" on behalf of an original\n * FederatedEvent or native Event.\n */\nvar FederatedEvent = /** @class */ (function () {\n /**\n * The event boundary which manages this event. Propagation can only occur\n * within the boundary's jurisdiction.\n */\n function FederatedEvent(manager) {\n /**\n * The propagation phase.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/eventPhase\n */\n this.eventPhase = FederatedEvent.prototype.NONE;\n /**\n * @see https://developer.mozilla.org/zh-CN/docs/Web/API/Event/bubbles\n */\n this.bubbles = true;\n /**\n * @see https://developer.mozilla.org/zh-CN/docs/Web/API/Event/cancelBubble\n */\n this.cancelBubble = true;\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/cancelable\n */\n this.cancelable = false;\n /** Flags whether the default response of the user agent was prevent through this event. */\n this.defaultPrevented = false;\n /** Flags whether propagation was stopped. */\n this.propagationStopped = false;\n /** Flags whether propagation was immediately stopped. */\n this.propagationImmediatelyStopped = false;\n /**\n * The coordinates of the evnet relative to the nearest DOM layer.\n * This is a non-standard property.\n */\n this.layer = new Point();\n /**\n * The coordinates of the event relative to the DOM document.\n * This is a non-standard property.\n * relative to the DOM document.\n * @see https://developer.mozilla.org/zh-CN/docs/Web/API/MouseEvent/pageX\n */\n this.page = new Point();\n /**\n * relative to Canvas, origin is left-top\n */\n this.canvas = new Point();\n /**\n * relative to Viewport, account for Camera\n */\n this.viewport = new Point();\n this.composed = false;\n this.NONE = 0;\n this.CAPTURING_PHASE = 1;\n this.AT_TARGET = 2;\n this.BUBBLING_PHASE = 3;\n this.manager = manager;\n }\n Object.defineProperty(FederatedEvent.prototype, \"name\", {\n /**\n * @deprecated\n */\n get: function () {\n return this.type;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FederatedEvent.prototype, \"layerX\", {\n get: function () {\n return this.layer.x;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FederatedEvent.prototype, \"layerY\", {\n get: function () {\n return this.layer.y;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FederatedEvent.prototype, \"pageX\", {\n get: function () {\n return this.page.x;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FederatedEvent.prototype, \"pageY\", {\n get: function () {\n return this.page.y;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FederatedEvent.prototype, \"x\", {\n get: function () {\n return this.canvas.x;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FederatedEvent.prototype, \"y\", {\n get: function () {\n return this.canvas.y;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FederatedEvent.prototype, \"canvasX\", {\n get: function () {\n return this.canvas.x;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FederatedEvent.prototype, \"canvasY\", {\n get: function () {\n return this.canvas.y;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FederatedEvent.prototype, \"viewportX\", {\n get: function () {\n return this.viewport.x;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FederatedEvent.prototype, \"viewportY\", {\n get: function () {\n return this.viewport.y;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * The propagation path for this event\n * @see https://developer.mozilla.org/zh-CN/docs/Web/API/Event/composedPath\n *\n * So composedPath()[0] represents the original target.\n * @see https://polymer-library.polymer-project.org/3.0/docs/devguide/events#retargeting\n */\n FederatedEvent.prototype.composedPath = function () {\n if (this.manager && (!this.path || this.path[0] !== this.target)) {\n this.path = this.target ? this.manager.propagationPath(this.target) : [];\n }\n return this.path;\n };\n Object.defineProperty(FederatedEvent.prototype, \"propagationPath\", {\n /**\n * @deprecated\n */\n get: function () {\n return this.composedPath();\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @see https://developer.mozilla.org/zh-CN/docs/Web/API/Event/preventDefault\n */\n FederatedEvent.prototype.preventDefault = function () {\n if (this.nativeEvent instanceof Event && this.nativeEvent.cancelable) {\n this.nativeEvent.preventDefault();\n }\n this.defaultPrevented = true;\n };\n /**\n * @see https://developer.mozilla.org/zh-CN/docs/Web/API/Event/stopImmediatePropagation\n */\n FederatedEvent.prototype.stopImmediatePropagation = function () {\n this.propagationImmediatelyStopped = true;\n };\n /**\n * @see https://developer.mozilla.org/zh-CN/docs/Web/API/Event/stopPropagation\n */\n FederatedEvent.prototype.stopPropagation = function () {\n this.propagationStopped = true;\n };\n /**\n * added for compatibility with DOM Event,\n * deprecated props and methods\n */\n FederatedEvent.prototype.initEvent = function () { };\n FederatedEvent.prototype.initUIEvent = function () { };\n FederatedEvent.prototype.clone = function () {\n throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);\n };\n return FederatedEvent;\n}());\n\nvar FederatedMouseEvent = /** @class */ (function (_super) {\n __extends(FederatedMouseEvent, _super);\n function FederatedMouseEvent() {\n var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;\n /**\n * The coordinates of the mouse event relative to the canvas.\n */\n _this.client = new Point();\n /**\n * The movement in this pointer relative to the last `mousemove` event.\n */\n _this.movement = new Point();\n /**\n * The offset of the pointer coordinates w.r.t. target DisplayObject in world space. This is\n * not supported at the moment.\n */\n _this.offset = new Point();\n /**\n * The pointer coordinates in world space.\n */\n _this.global = new Point();\n /**\n * The pointer coordinates in sceen space.\n */\n _this.screen = new Point();\n return _this;\n }\n Object.defineProperty(FederatedMouseEvent.prototype, \"clientX\", {\n get: function () {\n return this.client.x;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FederatedMouseEvent.prototype, \"clientY\", {\n get: function () {\n return this.client.y;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FederatedMouseEvent.prototype, \"movementX\", {\n get: function () {\n return this.movement.x;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FederatedMouseEvent.prototype, \"movementY\", {\n get: function () {\n return this.movement.y;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FederatedMouseEvent.prototype, \"offsetX\", {\n get: function () {\n return this.offset.x;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FederatedMouseEvent.prototype, \"offsetY\", {\n get: function () {\n return this.offset.y;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FederatedMouseEvent.prototype, \"globalX\", {\n get: function () {\n return this.global.x;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FederatedMouseEvent.prototype, \"globalY\", {\n get: function () {\n return this.global.y;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FederatedMouseEvent.prototype, \"screenX\", {\n get: function () {\n return this.screen.x;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FederatedMouseEvent.prototype, \"screenY\", {\n get: function () {\n return this.screen.y;\n },\n enumerable: false,\n configurable: true\n });\n FederatedMouseEvent.prototype.getModifierState = function (key) {\n return ('getModifierState' in this.nativeEvent &&\n this.nativeEvent.getModifierState(key));\n };\n FederatedMouseEvent.prototype.initMouseEvent = function () {\n throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);\n };\n return FederatedMouseEvent;\n}(FederatedEvent));\n\n// @ts-ignore\nvar FederatedPointerEvent = /** @class */ (function (_super) {\n __extends(FederatedPointerEvent, _super);\n function FederatedPointerEvent() {\n var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;\n /**\n * The width of the pointer's contact along the x-axis, measured in CSS pixels.\n * radiusX of TouchEvents will be represented by this value.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/width\n */\n _this.width = 0;\n /**\n * The height of the pointer's contact along the y-axis, measured in CSS pixels.\n * radiusY of TouchEvents will be represented by this value.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/height\n */\n _this.height = 0;\n /**\n * Indicates whether or not the pointer device that created the event is the primary pointer.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/isPrimary\n */\n _this.isPrimary = false;\n return _this;\n }\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/getCoalescedEvents\n */\n FederatedPointerEvent.prototype.getCoalescedEvents = function () {\n if (this.type === 'pointermove' ||\n this.type === 'mousemove' ||\n this.type === 'touchmove') {\n // @ts-ignore\n return [this];\n }\n return [];\n };\n /**\n * @see https://chromestatus.com/feature/5765569655603200\n */\n FederatedPointerEvent.prototype.getPredictedEvents = function () {\n throw new Error('getPredictedEvents is not supported!');\n };\n /**\n * @see https://github.com/antvis/G/issues/1115\n * We currently reuses event objects in the event system,\n * avoiding the creation of a large number of event objects.\n * Reused objects are only used to carry different data,\n * such as coordinate information, native event objects,\n * and therefore the lifecycle is limited to the event handler,\n * which can lead to unintended consequences if an attempt is made to cache the entire event object.\n *\n * Therefore, while keeping the above performance considerations in mind, it is possible to provide a clone method that creates a new object when the user really wants to cache it, e.g.\n */\n FederatedPointerEvent.prototype.clone = function () {\n return this.manager.clonePointerEvent(this);\n };\n return FederatedPointerEvent;\n}(FederatedMouseEvent));\n\n// @ts-ignore\nvar FederatedWheelEvent = /** @class */ (function (_super) {\n __extends(FederatedWheelEvent, _super);\n function FederatedWheelEvent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n FederatedWheelEvent.prototype.clone = function () {\n return this.manager.cloneWheelEvent(this);\n };\n return FederatedWheelEvent;\n}(FederatedMouseEvent));\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/Events/Creating_and_triggering_events\n *\n * @example\n const event = new CustomEvent('build', { detail: { prop1: 'xx' } });\n circle.addEventListener('build', (e) => {\n e.target; // circle\n e.detail; // { prop1: 'xx' }\n });\n\n circle.dispatchEvent(event);\n */\nvar CustomEvent = /** @class */ (function (_super) {\n __extends(CustomEvent, _super);\n // eslint-disable-next-line @typescript-eslint/ban-types\n function CustomEvent(eventName, object) {\n var _this = _super.call(this, null) || this;\n _this.type = eventName;\n _this.detail = object;\n // compatible with G 3.0\n Object.assign(_this, object);\n return _this;\n }\n return CustomEvent;\n}(FederatedEvent));\n\nvar DELEGATION_SPLITTER = ':';\n/**\n * Objects that can receive events and may have listeners for them.\n * eg. Element, Canvas, DisplayObject\n * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget\n */\nvar EventTarget = /** @class */ (function () {\n function EventTarget() {\n /**\n * event emitter\n */\n this.emitter = new EventEmitter();\n }\n /**\n * @deprecated\n * @alias addEventListener\n */\n EventTarget.prototype.on = function (type, listener, options) {\n this.addEventListener(type, listener, options);\n return this;\n };\n /**\n * support `capture` & `once` in options\n * @see https://developer.mozilla.org/zh-CN/docs/Web/API/EventTarget/addEventListener\n */\n EventTarget.prototype.addEventListener = function (type, listener, options) {\n var capture = (isBoolean(options) && options) || (isObject(options) && options.capture);\n var once = isObject(options) && options.once;\n var context = isFunction(listener) ? undefined : listener;\n // compatible with G 3.0\n // support using delegate name in event type, eg. 'node:click'\n var useDelegatedName = false;\n var delegatedName = '';\n if (type.indexOf(DELEGATION_SPLITTER) > -1) {\n var _a = __read(type.split(DELEGATION_SPLITTER), 2), name_1 = _a[0], eventType = _a[1];\n type = eventType;\n delegatedName = name_1;\n useDelegatedName = true;\n }\n type = capture ? \"\".concat(type, \"capture\") : type;\n listener = isFunction(listener) ? listener : listener.handleEvent;\n // compatible with G 3.0\n if (useDelegatedName) {\n var originListener_1 = listener;\n listener = function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (((_a = args[0].target) === null || _a === void 0 ? void 0 : _a.name) !== delegatedName) {\n return;\n }\n // @ts-ignore\n originListener_1.apply(void 0, __spreadArray([], __read(args), false));\n };\n }\n if (once) {\n this.emitter.once(type, listener, context);\n }\n else {\n this.emitter.on(type, listener, context);\n }\n return this;\n };\n /**\n * @deprecated\n * @alias removeEventListener\n */\n EventTarget.prototype.off = function (type, listener, options) {\n if (type) {\n this.removeEventListener(type, listener, options);\n }\n else {\n // remove all listeners\n this.removeAllEventListeners();\n }\n return this;\n };\n EventTarget.prototype.removeAllEventListeners = function () {\n this.emitter.removeAllListeners();\n };\n EventTarget.prototype.removeEventListener = function (type, listener, options) {\n var capture = (isBoolean(options) && options) || (isObject(options) && options.capture);\n var context = isFunction(listener) ? undefined : listener;\n type = capture ? \"\".concat(type, \"capture\") : type;\n listener = isFunction(listener) ? listener : listener === null || listener === void 0 ? void 0 : listener.handleEvent;\n this.emitter.off(type, listener, context);\n return this;\n };\n /**\n * @deprecated\n * @alias dispatchEvent\n */\n // eslint-disable-next-line @typescript-eslint/ban-types\n EventTarget.prototype.emit = function (eventName, object) {\n this.dispatchEvent(new CustomEvent(eventName, object));\n };\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/dispatchEvent\n */\n EventTarget.prototype.dispatchEvent = function (e, skipPropagate) {\n var _a, _b;\n if (skipPropagate === void 0) { skipPropagate = false; }\n if (!isFederatedEvent(e)) {\n throw new Error('DisplayObject cannot propagate events outside of the Federated Events API');\n }\n // should account for Element / Document / Canvas\n var canvas;\n // @ts-ignore\n if (this.document) {\n canvas = this;\n // @ts-ignore\n }\n else if (this.defaultView) {\n canvas = this.defaultView;\n }\n else {\n canvas = (_a = this.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView;\n }\n // assign event manager\n if (canvas) {\n e.manager = canvas.getEventService() || null;\n if (!e.manager) {\n return false;\n }\n e.defaultPrevented = false;\n e.path = [];\n if (!skipPropagate) {\n e.target = this;\n }\n (_b = e.manager) === null || _b === void 0 ? void 0 : _b.dispatchEvent(e, e.type, skipPropagate);\n }\n return !e.defaultPrevented;\n };\n return EventTarget;\n}());\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Node\n */\nvar Node = /** @class */ (function (_super) {\n __extends(Node, _super);\n function Node() {\n var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;\n _this.shadow = false;\n /**\n * points to canvas.document\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Node/ownerDocument\n */\n _this.ownerDocument = null;\n /**\n * @see https://developer.mozilla.org/zh-CN/docs/Web/API/Node/isConnected\n * @example\n circle.isConnected; // false\n canvas.appendChild(circle);\n circle.isConnected; // true\n */\n _this.isConnected = false;\n /**\n * Returns node's node document's document base URL.\n * @see https://developer.mozilla.org/zh-CN/docs/Web/API/Node\n */\n _this.baseURI = '';\n /**\n * Returns the children.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Node/childNodes\n */\n _this.childNodes = [];\n /**\n * @see https://developer.mozilla.org/zh-CN/docs/Web/API/Node/nodeType\n */\n _this.nodeType = 0;\n /**\n * @see https://developer.mozilla.org/zh-CN/docs/Web/API/Node/nodeName\n */\n _this.nodeName = '';\n /**\n * @see https://developer.mozilla.org/zh-CN/docs/Web/API/Node/nodeValue\n */\n _this.nodeValue = null;\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/API/ParentNode\n */\n _this.parentNode = null;\n return _this;\n }\n Node.isNode = function (target) {\n return !!target.childNodes;\n };\n Object.defineProperty(Node.prototype, \"textContent\", {\n /**\n * @see https://developer.mozilla.org/zh-CN/docs/Web/API/Node/textContent\n */\n get: function () {\n var e_1, _a;\n var out = '';\n if (this.nodeName === Shape.TEXT) {\n // @ts-ignore\n out += this.style.text;\n }\n try {\n for (var _b = __values(this.childNodes), _c = _b.next(); !_c.done; _c = _b.next()) {\n var child = _c.value;\n if (child.nodeName === Shape.TEXT) {\n out += child.nodeValue;\n }\n else {\n out += child.textContent;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return out;\n },\n set: function (content) {\n var _this = this;\n // remove all children\n this.childNodes.slice().forEach(function (child) {\n _this.removeChild(child);\n });\n if (this.nodeName === Shape.TEXT) {\n // @ts-ignore\n this.style.text = \"\".concat(content);\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @see https://developer.mozilla.org/zh-CN/docs/Web/API/Node/getRootNode\n */\n Node.prototype.getRootNode = function (opts) {\n if (opts === void 0) { opts = {}; }\n if (this.parentNode) {\n return this.parentNode.getRootNode(opts);\n }\n if (opts.composed && this.host) {\n return this.host.getRootNode(opts);\n }\n return this;\n };\n Node.prototype.hasChildNodes = function () {\n return this.childNodes.length > 0;\n };\n Node.prototype.isDefaultNamespace = function (namespace) {\n throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);\n };\n Node.prototype.lookupNamespaceURI = function (prefix) {\n throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);\n };\n Node.prototype.lookupPrefix = function (namespace) {\n throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);\n };\n Node.prototype.normalize = function () {\n throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);\n };\n /**\n * @see https://developer.mozilla.org/zh-CN/docs/Web/API/Node/isEqualNode\n */\n Node.prototype.isEqualNode = function (otherNode) {\n // TODO: compare 2 nodes, not sameness\n return this === otherNode;\n };\n Node.prototype.isSameNode = function (otherNode) {\n return this.isEqualNode(otherNode);\n };\n Object.defineProperty(Node.prototype, \"parent\", {\n /**\n * @deprecated\n * @alias parentNode\n */\n get: function () {\n return this.parentNode;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"parentElement\", {\n get: function () {\n return null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"nextSibling\", {\n get: function () {\n return null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"previousSibling\", {\n get: function () {\n return null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"firstChild\", {\n get: function () {\n return this.childNodes.length > 0 ? this.childNodes[0] : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"lastChild\", {\n get: function () {\n return this.childNodes.length > 0\n ? this.childNodes[this.childNodes.length - 1]\n : null;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition\n * @see https://github.com/b-fuze/deno-dom/blob/master/src/dom/node.ts#L338\n */\n Node.prototype.compareDocumentPosition = function (other) {\n var _a;\n if (other === this) {\n // same node\n return 0;\n }\n // if (!(other instanceof Node)) {\n // throw new TypeError(\n // 'Node.compareDocumentPosition: Argument 1 does not implement interface Node.',\n // );\n // }\n var node1Root = other;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var node2Root = this;\n var node1Hierarchy = [node1Root];\n var node2Hierarchy = [node2Root];\n while ((_a = node1Root.parentNode) !== null && _a !== void 0 ? _a : node2Root.parentNode) {\n node1Root = node1Root.parentNode\n ? (node1Hierarchy.push(node1Root.parentNode), node1Root.parentNode)\n : node1Root;\n node2Root = node2Root.parentNode\n ? (node2Hierarchy.push(node2Root.parentNode), node2Root.parentNode)\n : node2Root;\n }\n // Check if they don't share the same root node\n if (node1Root !== node2Root) {\n return (Node.DOCUMENT_POSITION_DISCONNECTED |\n Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC |\n Node.DOCUMENT_POSITION_PRECEDING);\n }\n var longerHierarchy = node1Hierarchy.length > node2Hierarchy.length\n ? node1Hierarchy\n : node2Hierarchy;\n var shorterHierarchy = longerHierarchy === node1Hierarchy ? node2Hierarchy : node1Hierarchy;\n // Check if either is a container of the other\n if (longerHierarchy[longerHierarchy.length - shorterHierarchy.length] ===\n shorterHierarchy[0]) {\n return longerHierarchy === node1Hierarchy\n ? // other is a child of this\n Node.DOCUMENT_POSITION_CONTAINED_BY | Node.DOCUMENT_POSITION_FOLLOWING\n : // this is a child of other\n Node.DOCUMENT_POSITION_CONTAINS | Node.DOCUMENT_POSITION_PRECEDING;\n }\n // Find their first common ancestor and see whether they\n // are preceding or following\n var longerStart = longerHierarchy.length - shorterHierarchy.length;\n for (var i = shorterHierarchy.length - 1; i >= 0; i--) {\n var shorterHierarchyNode = shorterHierarchy[i];\n var longerHierarchyNode = longerHierarchy[longerStart + i];\n // We found the first common ancestor\n if (longerHierarchyNode !== shorterHierarchyNode) {\n var siblings = shorterHierarchyNode.parentNode.childNodes;\n if (siblings.indexOf(shorterHierarchyNode) <\n siblings.indexOf(longerHierarchyNode)) {\n // Shorter is before longer\n if (shorterHierarchy === node1Hierarchy) {\n // Other is before this\n return Node.DOCUMENT_POSITION_PRECEDING;\n }\n else {\n // This is before other\n return Node.DOCUMENT_POSITION_FOLLOWING;\n }\n }\n else {\n // Longer is before shorter\n if (longerHierarchy === node1Hierarchy) {\n // Other is before this\n return Node.DOCUMENT_POSITION_PRECEDING;\n }\n else {\n // Other is after this\n return Node.DOCUMENT_POSITION_FOLLOWING;\n }\n }\n }\n }\n return Node.DOCUMENT_POSITION_FOLLOWING;\n };\n /**\n * @deprecated\n * @alias contains\n */\n Node.prototype.contain = function (other) {\n return this.contains(other);\n };\n Node.prototype.contains = function (other) {\n // the node itself, one of its direct children\n var tmp = other;\n // @see https://developer.mozilla.org/en-US/docs/Web/API/Node/contains\n while (tmp && this !== tmp) {\n tmp = tmp.parentNode;\n }\n return !!tmp;\n };\n Node.prototype.getAncestor = function (n) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var temp = this;\n while (n > 0 && temp) {\n temp = temp.parentNode;\n n--;\n }\n return temp;\n };\n Node.prototype.forEach = function (callback, assigned) {\n if (assigned === void 0) { assigned = false; }\n if (!callback(this)) {\n (assigned ? this.childNodes.slice() : this.childNodes).forEach(function (child) {\n child.forEach(callback);\n });\n }\n };\n /**\n * Both nodes are in different documents or different trees in the same document.\n */\n Node.DOCUMENT_POSITION_DISCONNECTED = 1;\n /**\n * otherNode precedes the node in either a pre-order depth-first traversal\n * of a tree containing both (e.g., as an ancestor or previous sibling or a descendant of a previous sibling or previous sibling of an ancestor) or (if they are disconnected) in an arbitrary but consistent ordering.\n */\n Node.DOCUMENT_POSITION_PRECEDING = 2;\n /**\n * otherNode follows the node in either a pre-order depth-first traversal of a tree containing both (e.g., as a descendant or following sibling or a descendant of a following sibling or following sibling of an ancestor) or (if they are disconnected) in an arbitrary but consistent ordering.\n */\n Node.DOCUMENT_POSITION_FOLLOWING = 4;\n /**\n * otherNode is an ancestor of the node.\n */\n Node.DOCUMENT_POSITION_CONTAINS = 8;\n /**\n * otherNode is a descendant of the node.\n */\n Node.DOCUMENT_POSITION_CONTAINED_BY = 16;\n /**\n * The result relies upon arbitrary and/or implementation-specific behavior and is not guaranteed to be portable.\n */\n Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32;\n return Node;\n}(EventTarget));\n\nvar PROPAGATION_LIMIT = 2048;\nvar EventService = /** @class */ (function () {\n function EventService(globalRuntime, context) {\n var _this = this;\n this.globalRuntime = globalRuntime;\n this.context = context;\n this.emitter = new EventEmitter();\n /**\n * Store HTML elements in current canvas.\n */\n this.nativeHTMLMap = new WeakMap();\n this.cursor = 'default';\n this.mappingTable = {};\n this.mappingState = {\n trackingData: {},\n };\n this.eventPool = new Map();\n this.tmpMatrix = mat4.create();\n this.tmpVec3 = vec3.create();\n this.onPointerDown = function (from) {\n var e = _this.createPointerEvent(from);\n _this.dispatchEvent(e, 'pointerdown');\n if (e.pointerType === 'touch') {\n _this.dispatchEvent(e, 'touchstart');\n }\n else if (e.pointerType === 'mouse' || e.pointerType === 'pen') {\n var isRightButton = e.button === 2;\n _this.dispatchEvent(e, isRightButton ? 'rightdown' : 'mousedown');\n }\n var trackingData = _this.trackingData(from.pointerId);\n trackingData.pressTargetsByButton[from.button] = e.composedPath();\n _this.freeEvent(e);\n };\n this.onPointerUp = function (from) {\n var _a;\n var now = clock.now();\n var e = _this.createPointerEvent(from, undefined, undefined, _this.context.config.alwaysTriggerPointerEventOnCanvas\n ? _this.rootTarget\n : undefined);\n _this.dispatchEvent(e, 'pointerup');\n if (e.pointerType === 'touch') {\n _this.dispatchEvent(e, 'touchend');\n }\n else if (e.pointerType === 'mouse' || e.pointerType === 'pen') {\n var isRightButton = e.button === 2;\n _this.dispatchEvent(e, isRightButton ? 'rightup' : 'mouseup');\n }\n var trackingData = _this.trackingData(from.pointerId);\n var pressTarget = _this.findMountedTarget(trackingData.pressTargetsByButton[from.button]);\n var clickTarget = pressTarget;\n // pointerupoutside only bubbles. It only bubbles upto the parent that doesn't contain\n // the pointerup location.\n if (pressTarget && !e.composedPath().includes(pressTarget)) {\n var currentTarget = pressTarget;\n while (currentTarget && !e.composedPath().includes(currentTarget)) {\n e.currentTarget = currentTarget;\n _this.notifyTarget(e, 'pointerupoutside');\n if (e.pointerType === 'touch') {\n _this.notifyTarget(e, 'touchendoutside');\n }\n else if (e.pointerType === 'mouse' || e.pointerType === 'pen') {\n var isRightButton = e.button === 2;\n _this.notifyTarget(e, isRightButton ? 'rightupoutside' : 'mouseupoutside');\n }\n if (Node.isNode(currentTarget)) {\n currentTarget = currentTarget.parentNode;\n }\n }\n delete trackingData.pressTargetsByButton[from.button];\n // currentTarget is the most specific ancestor holding both the pointerdown and pointerup\n // targets. That is - it's our click target!\n clickTarget = currentTarget;\n }\n if (clickTarget) {\n var clickEvent = _this.clonePointerEvent(e, 'click');\n clickEvent.target = clickTarget;\n clickEvent.path = [];\n if (!trackingData.clicksByButton[from.button]) {\n trackingData.clicksByButton[from.button] = {\n clickCount: 0,\n target: clickEvent.target,\n timeStamp: now,\n };\n }\n var clickHistory = trackingData.clicksByButton[from.button];\n if (clickHistory.target === clickEvent.target &&\n now - clickHistory.timeStamp < 200) {\n ++clickHistory.clickCount;\n }\n else {\n clickHistory.clickCount = 1;\n }\n clickHistory.target = clickEvent.target;\n clickHistory.timeStamp = now;\n clickEvent.detail = clickHistory.clickCount;\n // @see https://github.com/antvis/G/issues/1091\n if (!((_a = e.detail) === null || _a === void 0 ? void 0 : _a.preventClick)) {\n if (!_this.context.config.useNativeClickEvent &&\n (clickEvent.pointerType === 'mouse' ||\n clickEvent.pointerType === 'touch')) {\n _this.dispatchEvent(clickEvent, 'click');\n }\n _this.dispatchEvent(clickEvent, 'pointertap');\n }\n _this.freeEvent(clickEvent);\n }\n _this.freeEvent(e);\n };\n this.onPointerMove = function (from) {\n var e = _this.createPointerEvent(from, undefined, undefined, _this.context.config.alwaysTriggerPointerEventOnCanvas\n ? _this.rootTarget\n : undefined);\n var isMouse = e.pointerType === 'mouse' || e.pointerType === 'pen';\n var trackingData = _this.trackingData(from.pointerId);\n var outTarget = _this.findMountedTarget(trackingData.overTargets);\n // First pointerout/pointerleave\n if (trackingData.overTargets && outTarget !== e.target) {\n // pointerout always occurs on the overTarget when the pointer hovers over another element.\n var outType = from.type === 'mousemove' ? 'mouseout' : 'pointerout';\n var outEvent = _this.createPointerEvent(from, outType, outTarget || undefined);\n _this.dispatchEvent(outEvent, 'pointerout');\n if (isMouse)\n _this.dispatchEvent(outEvent, 'mouseout');\n // If the pointer exits overTarget and its descendants, then a pointerleave event is also fired. This event\n // is dispatched to all ancestors that no longer capture the pointer.\n if (!e.composedPath().includes(outTarget)) {\n var leaveEvent = _this.createPointerEvent(from, 'pointerleave', outTarget || undefined);\n leaveEvent.eventPhase = leaveEvent.AT_TARGET;\n while (leaveEvent.target &&\n !e.composedPath().includes(leaveEvent.target)) {\n leaveEvent.currentTarget = leaveEvent.target;\n _this.notifyTarget(leaveEvent);\n if (isMouse) {\n _this.notifyTarget(leaveEvent, 'mouseleave');\n }\n if (Node.isNode(leaveEvent.target)) {\n leaveEvent.target = leaveEvent.target.parentNode;\n }\n }\n _this.freeEvent(leaveEvent);\n }\n _this.freeEvent(outEvent);\n }\n // Then pointerover\n if (outTarget !== e.target) {\n // pointerover always occurs on the new overTarget\n var overType = from.type === 'mousemove' ? 'mouseover' : 'pointerover';\n var overEvent = _this.clonePointerEvent(e, overType); // clone faster\n _this.dispatchEvent(overEvent, 'pointerover');\n if (isMouse)\n _this.dispatchEvent(overEvent, 'mouseover');\n // Probe whether the newly hovered Node is an ancestor of the original overTarget.\n var overTargetAncestor = outTarget && Node.isNode(outTarget) && outTarget.parentNode;\n while (overTargetAncestor &&\n overTargetAncestor !==\n (Node.isNode(_this.rootTarget) && _this.rootTarget.parentNode)) {\n if (overTargetAncestor === e.target)\n break;\n overTargetAncestor = overTargetAncestor.parentNode;\n }\n // The pointer has entered a non-ancestor of the original overTarget. This means we need a pointerentered\n // event.\n var didPointerEnter = !overTargetAncestor ||\n overTargetAncestor ===\n (Node.isNode(_this.rootTarget) && _this.rootTarget.parentNode);\n if (didPointerEnter) {\n var enterEvent = _this.clonePointerEvent(e, 'pointerenter');\n enterEvent.eventPhase = enterEvent.AT_TARGET;\n while (enterEvent.target &&\n enterEvent.target !== outTarget &&\n enterEvent.target !==\n (Node.isNode(_this.rootTarget) && _this.rootTarget.parentNode)) {\n enterEvent.currentTarget = enterEvent.target;\n _this.notifyTarget(enterEvent);\n if (isMouse)\n _this.notifyTarget(enterEvent, 'mouseenter');\n if (Node.isNode(enterEvent.target)) {\n enterEvent.target = enterEvent.target.parentNode;\n }\n }\n _this.freeEvent(enterEvent);\n }\n _this.freeEvent(overEvent);\n }\n // Then pointermove\n _this.dispatchEvent(e, 'pointermove');\n if (e.pointerType === 'touch')\n _this.dispatchEvent(e, 'touchmove');\n if (isMouse) {\n _this.dispatchEvent(e, 'mousemove');\n _this.cursor = _this.getCursor(e.target);\n }\n trackingData.overTargets = e.composedPath();\n _this.freeEvent(e);\n };\n this.onPointerOut = function (from) {\n var trackingData = _this.trackingData(from.pointerId);\n if (trackingData.overTargets) {\n var isMouse = from.pointerType === 'mouse' || from.pointerType === 'pen';\n var outTarget = _this.findMountedTarget(trackingData.overTargets);\n // pointerout first\n var outEvent = _this.createPointerEvent(from, 'pointerout', outTarget || undefined);\n _this.dispatchEvent(outEvent);\n if (isMouse)\n _this.dispatchEvent(outEvent, 'mouseout');\n // pointerleave(s) are also dispatched b/c the pointer must've left rootTarget and its descendants to\n // get an upstream pointerout event (upstream events do not know rootTarget has descendants).\n var leaveEvent = _this.createPointerEvent(from, 'pointerleave', outTarget || undefined);\n leaveEvent.eventPhase = leaveEvent.AT_TARGET;\n while (leaveEvent.target &&\n leaveEvent.target !==\n (Node.isNode(_this.rootTarget) && _this.rootTarget.parentNode)) {\n leaveEvent.currentTarget = leaveEvent.target;\n _this.notifyTarget(leaveEvent);\n if (isMouse) {\n _this.notifyTarget(leaveEvent, 'mouseleave');\n }\n if (Node.isNode(leaveEvent.target)) {\n leaveEvent.target = leaveEvent.target.parentNode;\n }\n }\n trackingData.overTargets = null;\n _this.freeEvent(outEvent);\n _this.freeEvent(leaveEvent);\n }\n _this.cursor = null;\n };\n this.onPointerOver = function (from) {\n var trackingData = _this.trackingData(from.pointerId);\n var e = _this.createPointerEvent(from);\n var isMouse = e.pointerType === 'mouse' || e.pointerType === 'pen';\n _this.dispatchEvent(e, 'pointerover');\n if (isMouse)\n _this.dispatchEvent(e, 'mouseover');\n if (e.pointerType === 'mouse')\n _this.cursor = _this.getCursor(e.target);\n // pointerenter events must be fired since the pointer entered from upstream.\n var enterEvent = _this.clonePointerEvent(e, 'pointerenter');\n enterEvent.eventPhase = enterEvent.AT_TARGET;\n while (enterEvent.target &&\n enterEvent.target !==\n (Node.isNode(_this.rootTarget) && _this.rootTarget.parentNode)) {\n enterEvent.currentTarget = enterEvent.target;\n _this.notifyTarget(enterEvent);\n if (isMouse) {\n // mouseenter should not bubble\n // @see https://developer.mozilla.org/en-US/docs/Web/API/Element/mouseenter_event#usage_notes\n _this.notifyTarget(enterEvent, 'mouseenter');\n }\n if (Node.isNode(enterEvent.target)) {\n enterEvent.target = enterEvent.target.parentNode;\n }\n }\n trackingData.overTargets = e.composedPath();\n _this.freeEvent(e);\n _this.freeEvent(enterEvent);\n };\n this.onPointerUpOutside = function (from) {\n var trackingData = _this.trackingData(from.pointerId);\n var pressTarget = _this.findMountedTarget(trackingData.pressTargetsByButton[from.button]);\n var e = _this.createPointerEvent(from);\n if (pressTarget) {\n var currentTarget = pressTarget;\n while (currentTarget) {\n e.currentTarget = currentTarget;\n _this.notifyTarget(e, 'pointerupoutside');\n if (e.pointerType === 'touch') ;\n else if (e.pointerType === 'mouse' || e.pointerType === 'pen') {\n _this.notifyTarget(e, e.button === 2 ? 'rightupoutside' : 'mouseupoutside');\n }\n if (Node.isNode(currentTarget)) {\n currentTarget = currentTarget.parentNode;\n }\n }\n delete trackingData.pressTargetsByButton[from.button];\n }\n _this.freeEvent(e);\n };\n this.onWheel = function (from) {\n var wheelEvent = _this.createWheelEvent(from);\n _this.dispatchEvent(wheelEvent);\n _this.freeEvent(wheelEvent);\n };\n this.onClick = function (from) {\n if (_this.context.config.useNativeClickEvent) {\n var e = _this.createPointerEvent(from);\n _this.dispatchEvent(e);\n _this.freeEvent(e);\n }\n };\n this.onPointerCancel = function (from) {\n var e = _this.createPointerEvent(from, undefined, undefined, _this.context.config.alwaysTriggerPointerEventOnCanvas\n ? _this.rootTarget\n : undefined);\n _this.dispatchEvent(e);\n _this.freeEvent(e);\n };\n }\n EventService.prototype.init = function () {\n this.rootTarget = this.context.renderingContext.root.parentNode; // document\n this.addEventMapping('pointerdown', this.onPointerDown);\n this.addEventMapping('pointerup', this.onPointerUp);\n this.addEventMapping('pointermove', this.onPointerMove);\n this.addEventMapping('pointerout', this.onPointerOut);\n this.addEventMapping('pointerleave', this.onPointerOut);\n this.addEventMapping('pointercancel', this.onPointerCancel);\n this.addEventMapping('pointerover', this.onPointerOver);\n this.addEventMapping('pointerupoutside', this.onPointerUpOutside);\n this.addEventMapping('wheel', this.onWheel);\n this.addEventMapping('click', this.onClick);\n };\n EventService.prototype.destroy = function () {\n this.emitter.removeAllListeners();\n this.mappingTable = {};\n this.mappingState = {};\n this.eventPool.clear();\n };\n EventService.prototype.client2Viewport = function (client) {\n var bbox = this.context.contextService.getBoundingClientRect();\n return new Point(client.x - ((bbox === null || bbox === void 0 ? void 0 : bbox.left) || 0), client.y - ((bbox === null || bbox === void 0 ? void 0 : bbox.top) || 0));\n };\n EventService.prototype.viewport2Client = function (canvas) {\n var bbox = this.context.contextService.getBoundingClientRect();\n return new Point(canvas.x + ((bbox === null || bbox === void 0 ? void 0 : bbox.left) || 0), canvas.y + ((bbox === null || bbox === void 0 ? void 0 : bbox.top) || 0));\n };\n EventService.prototype.viewport2Canvas = function (_a) {\n var x = _a.x, y = _a.y;\n var canvas = this.rootTarget.defaultView;\n var camera = canvas.getCamera();\n var _b = this.context.config, width = _b.width, height = _b.height;\n var projectionMatrixInverse = camera.getPerspectiveInverse();\n var worldMatrix = camera.getWorldTransform();\n var vpMatrix = mat4.multiply(this.tmpMatrix, worldMatrix, projectionMatrixInverse);\n var viewport = vec3.set(this.tmpVec3, (x / width) * 2 - 1, (1 - y / height) * 2 - 1, 0);\n vec3.transformMat4(viewport, viewport, vpMatrix);\n return new Point(viewport[0], viewport[1]);\n };\n EventService.prototype.canvas2Viewport = function (canvasP) {\n var canvas = this.rootTarget.defaultView;\n var camera = canvas.getCamera();\n // World -> Clip\n var projectionMatrix = camera.getPerspective();\n var viewMatrix = camera.getViewTransform();\n var vpMatrix = mat4.multiply(this.tmpMatrix, projectionMatrix, viewMatrix);\n var clip = vec3.set(this.tmpVec3, canvasP.x, canvasP.y, 0);\n vec3.transformMat4(this.tmpVec3, this.tmpVec3, vpMatrix);\n // Clip -> NDC -> Viewport, flip Y\n var _a = this.context.config, width = _a.width, height = _a.height;\n return new Point(((clip[0] + 1) / 2) * width, (1 - (clip[1] + 1) / 2) * height);\n };\n EventService.prototype.setPickHandler = function (pickHandler) {\n this.pickHandler = pickHandler;\n };\n EventService.prototype.addEventMapping = function (type, fn) {\n if (!this.mappingTable[type]) {\n this.mappingTable[type] = [];\n }\n this.mappingTable[type].push({\n fn: fn,\n priority: 0,\n });\n this.mappingTable[type].sort(function (a, b) { return a.priority - b.priority; });\n };\n EventService.prototype.mapEvent = function (e) {\n if (!this.rootTarget) {\n return;\n }\n var mappers = this.mappingTable[e.type];\n if (mappers) {\n for (var i = 0, j = mappers.length; i < j; i++) {\n mappers[i].fn(e);\n }\n }\n else {\n console.warn(\"[EventService]: Event mapping not defined for \".concat(e.type));\n }\n };\n EventService.prototype.dispatchEvent = function (e, type, skipPropagate) {\n // Canvas should skip\n if (!skipPropagate) {\n e.propagationStopped = false;\n e.propagationImmediatelyStopped = false;\n this.propagate(e, type);\n }\n else {\n // target phase\n e.eventPhase = e.AT_TARGET;\n var canvas = this.rootTarget.defaultView || null;\n e.currentTarget = canvas;\n this.notifyListeners(e, type);\n }\n this.emitter.emit(type || e.type, e);\n };\n EventService.prototype.propagate = function (e, type) {\n if (!e.target) {\n return;\n }\n // [target, parent, root, Canvas]\n var composedPath = e.composedPath();\n // event flow: capture -> target -> bubbling\n // capture phase\n e.eventPhase = e.CAPTURING_PHASE;\n for (var i = composedPath.length - 1; i >= 1; i--) {\n e.currentTarget = composedPath[i];\n this.notifyTarget(e, type);\n if (e.propagationStopped || e.propagationImmediatelyStopped)\n return;\n }\n // target phase\n e.eventPhase = e.AT_TARGET;\n e.currentTarget = e.target;\n this.notifyTarget(e, type);\n if (e.propagationStopped || e.propagationImmediatelyStopped)\n return;\n // find current target in composed path\n var index = composedPath.indexOf(e.currentTarget);\n // bubbling phase\n e.eventPhase = e.BUBBLING_PHASE;\n for (var i = index + 1; i < composedPath.length; i++) {\n e.currentTarget = composedPath[i];\n this.notifyTarget(e, type);\n if (e.propagationStopped || e.propagationImmediatelyStopped)\n return;\n }\n };\n EventService.prototype.propagationPath = function (target) {\n var propagationPath = [target];\n var canvas = this.rootTarget.defaultView || null;\n if (canvas && canvas === target) {\n propagationPath.unshift(canvas.document);\n return propagationPath;\n }\n for (var i = 0; i < PROPAGATION_LIMIT && target !== this.rootTarget; i++) {\n // if (Node.isNode(target) && !target.parentNode) {\n // throw new Error('Cannot find propagation path to disconnected target');\n // }\n if (Node.isNode(target) && target.parentNode) {\n // [target, parent, parent, root]\n propagationPath.push(target.parentNode);\n target = target.parentNode;\n }\n }\n if (canvas) {\n // @ts-ignore\n propagationPath.push(canvas);\n }\n return propagationPath;\n };\n EventService.prototype.hitTest = function (position) {\n var viewportX = position.viewportX, viewportY = position.viewportY;\n var _a = this.context.config, width = _a.width, height = _a.height, disableHitTesting = _a.disableHitTesting;\n // outside canvas\n if (viewportX < 0 ||\n viewportY < 0 ||\n viewportX > width ||\n viewportY > height) {\n return null;\n }\n return ((!disableHitTesting && this.pickHandler(position)) ||\n this.rootTarget || // return Document\n null);\n };\n /**\n * whether the native event trigger came from Canvas,\n * should account for HTML shape\n */\n EventService.prototype.isNativeEventFromCanvas = function (event) {\n var _a;\n var $el = this.context.contextService.getDomElement();\n var target = (_a = event.nativeEvent) === null || _a === void 0 ? void 0 : _a.target;\n if (target) {\n // from