{"version":3,"file":"bundle.umd.js","sources":["../../../../node_modules/d3-array/src/ascending.js","../../../../node_modules/d3-array/src/descending.js","../../../../node_modules/d3-array/src/bisector.js","../../../../node_modules/d3-array/src/number.js","../../../../node_modules/d3-array/src/bisect.js","../../../../node_modules/d3-array/src/count.js","../../../../node_modules/d3-array/src/extent.js","../../../../node_modules/d3-array/src/fsum.js","../../../../node_modules/d3-array/node_modules/internmap/src/index.js","../../../../node_modules/d3-array/src/identity.js","../../../../node_modules/d3-array/src/sort.js","../../../../node_modules/d3-array/src/array.js","../../../../node_modules/d3-array/src/constant.js","../../../../node_modules/d3-array/src/ticks.js","../../../../node_modules/d3-array/src/nice.js","../../../../node_modules/d3-array/src/threshold/sturges.js","../../../../node_modules/d3-array/src/bin.js","../../../../node_modules/d3-array/src/max.js","../../../../node_modules/d3-array/src/min.js","../../../../node_modules/d3-array/src/quickselect.js","../../../../node_modules/d3-array/src/quantile.js","../../../../node_modules/d3-array/src/merge.js","../../../../node_modules/d3-array/src/range.js","../../../../node_modules/d3-axis/src/identity.js","../../../../node_modules/d3-axis/src/axis.js","../../../../node_modules/d3-dispatch/src/dispatch.js","../../../../node_modules/d3-selection/src/namespaces.js","../../../../node_modules/d3-selection/src/namespace.js","../../../../node_modules/d3-selection/src/creator.js","../../../../node_modules/d3-selection/src/selector.js","../../../../node_modules/d3-selection/src/selection/select.js","../../../../node_modules/d3-selection/src/array.js","../../../../node_modules/d3-selection/src/selectorAll.js","../../../../node_modules/d3-selection/src/selection/selectAll.js","../../../../node_modules/d3-selection/src/matcher.js","../../../../node_modules/d3-selection/src/selection/selectChild.js","../../../../node_modules/d3-selection/src/selection/selectChildren.js","../../../../node_modules/d3-selection/src/selection/filter.js","../../../../node_modules/d3-selection/src/selection/sparse.js","../../../../node_modules/d3-selection/src/selection/enter.js","../../../../node_modules/d3-selection/src/constant.js","../../../../node_modules/d3-selection/src/selection/data.js","../../../../node_modules/d3-selection/src/selection/exit.js","../../../../node_modules/d3-selection/src/selection/join.js","../../../../node_modules/d3-selection/src/selection/merge.js","../../../../node_modules/d3-selection/src/selection/order.js","../../../../node_modules/d3-selection/src/selection/sort.js","../../../../node_modules/d3-selection/src/selection/call.js","../../../../node_modules/d3-selection/src/selection/nodes.js","../../../../node_modules/d3-selection/src/selection/node.js","../../../../node_modules/d3-selection/src/selection/size.js","../../../../node_modules/d3-selection/src/selection/empty.js","../../../../node_modules/d3-selection/src/selection/each.js","../../../../node_modules/d3-selection/src/selection/attr.js","../../../../node_modules/d3-selection/src/window.js","../../../../node_modules/d3-selection/src/selection/style.js","../../../../node_modules/d3-selection/src/selection/property.js","../../../../node_modules/d3-selection/src/selection/classed.js","../../../../node_modules/d3-selection/src/selection/text.js","../../../../node_modules/d3-selection/src/selection/html.js","../../../../node_modules/d3-selection/src/selection/raise.js","../../../../node_modules/d3-selection/src/selection/lower.js","../../../../node_modules/d3-selection/src/selection/append.js","../../../../node_modules/d3-selection/src/selection/insert.js","../../../../node_modules/d3-selection/src/selection/remove.js","../../../../node_modules/d3-selection/src/selection/clone.js","../../../../node_modules/d3-selection/src/selection/datum.js","../../../../node_modules/d3-selection/src/selection/on.js","../../../../node_modules/d3-selection/src/selection/dispatch.js","../../../../node_modules/d3-selection/src/selection/iterator.js","../../../../node_modules/d3-selection/src/selection/index.js","../../../../node_modules/d3-selection/src/select.js","../../../../node_modules/d3-selection/src/sourceEvent.js","../../../../node_modules/d3-selection/src/pointer.js","../../../../node_modules/d3-drag/src/noevent.js","../../../../node_modules/d3-drag/src/nodrag.js","../../../../node_modules/d3-color/src/define.js","../../../../node_modules/d3-color/src/color.js","../../../../node_modules/d3-interpolate/src/constant.js","../../../../node_modules/d3-interpolate/src/color.js","../../../../node_modules/d3-interpolate/src/rgb.js","../../../../node_modules/d3-interpolate/src/numberArray.js","../../../../node_modules/d3-interpolate/src/array.js","../../../../node_modules/d3-interpolate/src/date.js","../../../../node_modules/d3-interpolate/src/number.js","../../../../node_modules/d3-interpolate/src/object.js","../../../../node_modules/d3-interpolate/src/string.js","../../../../node_modules/d3-interpolate/src/value.js","../../../../node_modules/d3-interpolate/src/round.js","../../../../node_modules/d3-interpolate/src/transform/decompose.js","../../../../node_modules/d3-interpolate/src/transform/parse.js","../../../../node_modules/d3-interpolate/src/transform/index.js","../../../../node_modules/d3-interpolate/src/quantize.js","../../../../node_modules/d3-timer/src/timer.js","../../../../node_modules/d3-timer/src/timeout.js","../../../../node_modules/d3-transition/src/transition/schedule.js","../../../../node_modules/d3-transition/src/interrupt.js","../../../../node_modules/d3-transition/src/selection/interrupt.js","../../../../node_modules/d3-transition/src/transition/tween.js","../../../../node_modules/d3-transition/src/transition/interpolate.js","../../../../node_modules/d3-transition/src/transition/attr.js","../../../../node_modules/d3-transition/src/transition/attrTween.js","../../../../node_modules/d3-transition/src/transition/delay.js","../../../../node_modules/d3-transition/src/transition/duration.js","../../../../node_modules/d3-transition/src/transition/ease.js","../../../../node_modules/d3-transition/src/transition/easeVarying.js","../../../../node_modules/d3-transition/src/transition/filter.js","../../../../node_modules/d3-transition/src/transition/merge.js","../../../../node_modules/d3-transition/src/transition/on.js","../../../../node_modules/d3-transition/src/transition/remove.js","../../../../node_modules/d3-transition/src/transition/select.js","../../../../node_modules/d3-transition/src/transition/selectAll.js","../../../../node_modules/d3-transition/src/transition/selection.js","../../../../node_modules/d3-transition/src/transition/style.js","../../../../node_modules/d3-transition/src/transition/styleTween.js","../../../../node_modules/d3-transition/src/transition/text.js","../../../../node_modules/d3-transition/src/transition/textTween.js","../../../../node_modules/d3-transition/src/transition/transition.js","../../../../node_modules/d3-transition/src/transition/end.js","../../../../node_modules/d3-transition/src/transition/index.js","../../../../node_modules/d3-ease/src/linear.js","../../../../node_modules/d3-ease/src/cubic.js","../../../../node_modules/d3-transition/src/selection/transition.js","../../../../node_modules/d3-transition/src/selection/index.js","../../../../node_modules/d3-brush/src/constant.js","../../../../node_modules/d3-brush/src/event.js","../../../../node_modules/d3-brush/src/noevent.js","../../../../node_modules/d3-brush/src/brush.js","../../../../node_modules/d3-path/src/path.js","../../../../node_modules/d3-format/src/formatDecimal.js","../../../../node_modules/d3-format/src/exponent.js","../../../../node_modules/d3-format/src/formatGroup.js","../../../../node_modules/d3-format/src/formatNumerals.js","../../../../node_modules/d3-format/src/formatSpecifier.js","../../../../node_modules/d3-format/src/formatTrim.js","../../../../node_modules/d3-format/src/formatPrefixAuto.js","../../../../node_modules/d3-format/src/formatRounded.js","../../../../node_modules/d3-format/src/formatTypes.js","../../../../node_modules/d3-format/src/identity.js","../../../../node_modules/d3-format/src/locale.js","../../../../node_modules/d3-format/src/defaultLocale.js","../../../../node_modules/d3-format/src/precisionFixed.js","../../../../node_modules/d3-format/src/precisionPrefix.js","../../../../node_modules/d3-format/src/precisionRound.js","../../../../node_modules/d3-geo/src/math.js","../../../../node_modules/d3-geo/src/noop.js","../../../../node_modules/d3-geo/src/stream.js","../../../../node_modules/d3-geo/src/cartesian.js","../../../../node_modules/d3-geo/src/compose.js","../../../../node_modules/d3-geo/src/rotation.js","../../../../node_modules/d3-geo/src/circle.js","../../../../node_modules/d3-geo/src/clip/buffer.js","../../../../node_modules/d3-geo/src/pointEqual.js","../../../../node_modules/d3-geo/src/clip/rejoin.js","../../../../node_modules/d3-geo/src/polygonContains.js","../../../../node_modules/d3-geo/src/clip/index.js","../../../../node_modules/d3-geo/src/clip/antimeridian.js","../../../../node_modules/d3-geo/src/clip/circle.js","../../../../node_modules/d3-geo/src/clip/line.js","../../../../node_modules/d3-geo/src/clip/rectangle.js","../../../../node_modules/d3-geo/src/identity.js","../../../../node_modules/d3-geo/src/path/area.js","../../../../node_modules/d3-geo/src/path/bounds.js","../../../../node_modules/d3-geo/src/path/centroid.js","../../../../node_modules/d3-geo/src/path/context.js","../../../../node_modules/d3-geo/src/path/measure.js","../../../../node_modules/d3-geo/src/path/string.js","../../../../node_modules/d3-geo/src/path/index.js","../../../../node_modules/d3-geo/src/transform.js","../../../../node_modules/d3-geo/src/projection/fit.js","../../../../node_modules/d3-geo/src/projection/resample.js","../../../../node_modules/d3-geo/src/projection/index.js","../../../../node_modules/d3-geo/src/projection/conic.js","../../../../node_modules/d3-geo/src/projection/cylindricalEqualArea.js","../../../../node_modules/d3-geo/src/projection/conicEqualArea.js","../../../../node_modules/d3-geo/src/projection/albers.js","../../../../node_modules/d3-geo/src/projection/mercator.js","../../../../node_modules/d3-geo/src/projection/equirectangular.js","../../../../node_modules/d3-geo/src/projection/conicEquidistant.js","../../../../node_modules/d3-geo/src/projection/equalEarth.js","../../../../node_modules/d3-geo/src/projection/naturalEarth1.js","../../../../node_modules/d3-hierarchy/src/cluster.js","../../../../node_modules/d3-hierarchy/src/hierarchy/count.js","../../../../node_modules/d3-hierarchy/src/hierarchy/each.js","../../../../node_modules/d3-hierarchy/src/hierarchy/eachBefore.js","../../../../node_modules/d3-hierarchy/src/hierarchy/eachAfter.js","../../../../node_modules/d3-hierarchy/src/hierarchy/find.js","../../../../node_modules/d3-hierarchy/src/hierarchy/sum.js","../../../../node_modules/d3-hierarchy/src/hierarchy/sort.js","../../../../node_modules/d3-hierarchy/src/hierarchy/path.js","../../../../node_modules/d3-hierarchy/src/hierarchy/ancestors.js","../../../../node_modules/d3-hierarchy/src/hierarchy/descendants.js","../../../../node_modules/d3-hierarchy/src/hierarchy/leaves.js","../../../../node_modules/d3-hierarchy/src/hierarchy/links.js","../../../../node_modules/d3-hierarchy/src/hierarchy/iterator.js","../../../../node_modules/d3-hierarchy/src/hierarchy/index.js","../../../../node_modules/d3-hierarchy/src/accessors.js","../../../../node_modules/d3-hierarchy/src/constant.js","../../../../node_modules/d3-hierarchy/src/lcg.js","../../../../node_modules/d3-hierarchy/src/array.js","../../../../node_modules/d3-hierarchy/src/pack/enclose.js","../../../../node_modules/d3-hierarchy/src/pack/siblings.js","../../../../node_modules/d3-hierarchy/src/pack/index.js","../../../../node_modules/d3-hierarchy/src/treemap/round.js","../../../../node_modules/d3-hierarchy/src/treemap/dice.js","../../../../node_modules/d3-hierarchy/src/tree.js","../../../../node_modules/d3-hierarchy/src/treemap/slice.js","../../../../node_modules/d3-hierarchy/src/treemap/squarify.js","../../../../node_modules/d3-hierarchy/src/treemap/index.js","../../../../node_modules/d3-scale/src/init.js","../../../../node_modules/d3-scale/src/ordinal.js","../../../../node_modules/d3-scale/src/band.js","../../../../node_modules/d3-scale/src/constant.js","../../../../node_modules/d3-scale/src/number.js","../../../../node_modules/d3-scale/src/continuous.js","../../../../node_modules/d3-scale/src/tickFormat.js","../../../../node_modules/d3-scale/src/linear.js","../../../../node_modules/d3-scale/src/nice.js","../../../../node_modules/d3-scale/src/log.js","../../../../node_modules/d3-scale/src/quantize.js","../../../../node_modules/d3-time/src/interval.js","../../../../node_modules/d3-time/src/millisecond.js","../../../../node_modules/d3-time/src/duration.js","../../../../node_modules/d3-time/src/second.js","../../../../node_modules/d3-time/src/minute.js","../../../../node_modules/d3-time/src/hour.js","../../../../node_modules/d3-time/src/day.js","../../../../node_modules/d3-time/src/week.js","../../../../node_modules/d3-time/src/month.js","../../../../node_modules/d3-time/src/year.js","../../../../node_modules/d3-time/src/ticks.js","../../../../node_modules/d3-time-format/src/locale.js","../../../../node_modules/d3-time-format/src/defaultLocale.js","../../../../node_modules/d3-scale/src/time.js","../../../../node_modules/d3/node_modules/d3-shape/src/constant.js","../../../../node_modules/d3/node_modules/d3-shape/src/math.js","../../../../node_modules/d3/node_modules/d3-shape/src/path.js","../../../../node_modules/d3/node_modules/d3-shape/src/arc.js","../../../../node_modules/d3/node_modules/d3-shape/src/array.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/linear.js","../../../../node_modules/d3/node_modules/d3-shape/src/point.js","../../../../node_modules/d3/node_modules/d3-shape/src/line.js","../../../../node_modules/d3/node_modules/d3-shape/src/area.js","../../../../node_modules/d3/node_modules/d3-shape/src/descending.js","../../../../node_modules/d3/node_modules/d3-shape/src/identity.js","../../../../node_modules/d3/node_modules/d3-shape/src/pie.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/radial.js","../../../../node_modules/d3/node_modules/d3-shape/src/lineRadial.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/bump.js","../../../../node_modules/d3/node_modules/d3-shape/src/link.js","../../../../node_modules/d3/node_modules/d3-shape/src/noop.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/basis.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/basisClosed.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/basisOpen.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/bundle.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/cardinal.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/cardinalClosed.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/cardinalOpen.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/catmullRom.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/catmullRomClosed.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/catmullRomOpen.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/linearClosed.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/monotone.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/natural.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/step.js","../../../../node_modules/d3/node_modules/d3-shape/src/offset/none.js","../../../../node_modules/d3/node_modules/d3-shape/src/order/none.js","../../../../node_modules/d3/node_modules/d3-shape/src/stack.js","../../../../node_modules/d3/node_modules/d3-shape/src/offset/diverging.js","../../../../node_modules/d3-zoom/src/transform.js","../../../../node_modules/lodash-es/_freeGlobal.js","../../../../node_modules/lodash-es/_root.js","../../../../node_modules/lodash-es/_Symbol.js","../../../../node_modules/lodash-es/_getRawTag.js","../../../../node_modules/lodash-es/_objectToString.js","../../../../node_modules/lodash-es/_baseGetTag.js","../../../../node_modules/lodash-es/isObjectLike.js","../../../../node_modules/lodash-es/isSymbol.js","../../../../node_modules/lodash-es/_arrayMap.js","../../../../node_modules/lodash-es/isArray.js","../../../../node_modules/lodash-es/_baseToString.js","../../../../node_modules/lodash-es/_trimmedEndIndex.js","../../../../node_modules/lodash-es/_baseTrim.js","../../../../node_modules/lodash-es/isObject.js","../../../../node_modules/lodash-es/toNumber.js","../../../../node_modules/lodash-es/identity.js","../../../../node_modules/lodash-es/isFunction.js","../../../../node_modules/lodash-es/_coreJsData.js","../../../../node_modules/lodash-es/_isMasked.js","../../../../node_modules/lodash-es/_toSource.js","../../../../node_modules/lodash-es/_baseIsNative.js","../../../../node_modules/lodash-es/_getValue.js","../../../../node_modules/lodash-es/_getNative.js","../../../../node_modules/lodash-es/_WeakMap.js","../../../../node_modules/lodash-es/_baseCreate.js","../../../../node_modules/lodash-es/_apply.js","../../../../node_modules/lodash-es/noop.js","../../../../node_modules/lodash-es/_copyArray.js","../../../../node_modules/lodash-es/_shortOut.js","../../../../node_modules/lodash-es/constant.js","../../../../node_modules/lodash-es/_defineProperty.js","../../../../node_modules/lodash-es/_baseSetToString.js","../../../../node_modules/lodash-es/_setToString.js","../../../../node_modules/lodash-es/_arrayEach.js","../../../../node_modules/lodash-es/_baseFindIndex.js","../../../../node_modules/lodash-es/_baseIsNaN.js","../../../../node_modules/lodash-es/_strictIndexOf.js","../../../../node_modules/lodash-es/_baseIndexOf.js","../../../../node_modules/lodash-es/_arrayIncludes.js","../../../../node_modules/lodash-es/_isIndex.js","../../../../node_modules/lodash-es/_baseAssignValue.js","../../../../node_modules/lodash-es/eq.js","../../../../node_modules/lodash-es/_assignValue.js","../../../../node_modules/lodash-es/_copyObject.js","../../../../node_modules/lodash-es/_overRest.js","../../../../node_modules/lodash-es/_baseRest.js","../../../../node_modules/lodash-es/isLength.js","../../../../node_modules/lodash-es/isArrayLike.js","../../../../node_modules/lodash-es/_isIterateeCall.js","../../../../node_modules/lodash-es/_createAssigner.js","../../../../node_modules/lodash-es/_isPrototype.js","../../../../node_modules/lodash-es/_baseTimes.js","../../../../node_modules/lodash-es/_baseIsArguments.js","../../../../node_modules/lodash-es/isArguments.js","../../../../node_modules/lodash-es/stubFalse.js","../../../../node_modules/lodash-es/isBuffer.js","../../../../node_modules/lodash-es/_baseIsTypedArray.js","../../../../node_modules/lodash-es/_baseUnary.js","../../../../node_modules/lodash-es/_nodeUtil.js","../../../../node_modules/lodash-es/isTypedArray.js","../../../../node_modules/lodash-es/_arrayLikeKeys.js","../../../../node_modules/lodash-es/_overArg.js","../../../../node_modules/lodash-es/_nativeKeys.js","../../../../node_modules/lodash-es/_baseKeys.js","../../../../node_modules/lodash-es/keys.js","../../../../node_modules/lodash-es/_nativeKeysIn.js","../../../../node_modules/lodash-es/_baseKeysIn.js","../../../../node_modules/lodash-es/keysIn.js","../../../../node_modules/lodash-es/_isKey.js","../../../../node_modules/lodash-es/_nativeCreate.js","../../../../node_modules/lodash-es/_hashClear.js","../../../../node_modules/lodash-es/_hashDelete.js","../../../../node_modules/lodash-es/_hashGet.js","../../../../node_modules/lodash-es/_hashHas.js","../../../../node_modules/lodash-es/_hashSet.js","../../../../node_modules/lodash-es/_Hash.js","../../../../node_modules/lodash-es/_listCacheClear.js","../../../../node_modules/lodash-es/_assocIndexOf.js","../../../../node_modules/lodash-es/_listCacheDelete.js","../../../../node_modules/lodash-es/_listCacheGet.js","../../../../node_modules/lodash-es/_listCacheHas.js","../../../../node_modules/lodash-es/_listCacheSet.js","../../../../node_modules/lodash-es/_ListCache.js","../../../../node_modules/lodash-es/_Map.js","../../../../node_modules/lodash-es/_mapCacheClear.js","../../../../node_modules/lodash-es/_isKeyable.js","../../../../node_modules/lodash-es/_getMapData.js","../../../../node_modules/lodash-es/_mapCacheDelete.js","../../../../node_modules/lodash-es/_mapCacheGet.js","../../../../node_modules/lodash-es/_mapCacheHas.js","../../../../node_modules/lodash-es/_mapCacheSet.js","../../../../node_modules/lodash-es/_MapCache.js","../../../../node_modules/lodash-es/memoize.js","../../../../node_modules/lodash-es/_memoizeCapped.js","../../../../node_modules/lodash-es/_stringToPath.js","../../../../node_modules/lodash-es/toString.js","../../../../node_modules/lodash-es/_castPath.js","../../../../node_modules/lodash-es/_toKey.js","../../../../node_modules/lodash-es/_baseGet.js","../../../../node_modules/lodash-es/get.js","../../../../node_modules/lodash-es/_arrayPush.js","../../../../node_modules/lodash-es/_isFlattenable.js","../../../../node_modules/lodash-es/_baseFlatten.js","../../../../node_modules/lodash-es/flatten.js","../../../../node_modules/lodash-es/_getPrototype.js","../../../../node_modules/lodash-es/isPlainObject.js","../../../../node_modules/lodash-es/_baseSlice.js","../../../../node_modules/lodash-es/_castSlice.js","../../../../node_modules/lodash-es/_hasUnicode.js","../../../../node_modules/lodash-es/_asciiToArray.js","../../../../node_modules/lodash-es/_unicodeToArray.js","../../../../node_modules/lodash-es/_stringToArray.js","../../../../node_modules/lodash-es/_createCaseFirst.js","../../../../node_modules/lodash-es/upperFirst.js","../../../../node_modules/lodash-es/capitalize.js","../../../../node_modules/lodash-es/_arrayReduce.js","../../../../node_modules/lodash-es/_basePropertyOf.js","../../../../node_modules/lodash-es/_deburrLetter.js","../../../../node_modules/lodash-es/deburr.js","../../../../node_modules/lodash-es/_asciiWords.js","../../../../node_modules/lodash-es/_hasUnicodeWord.js","../../../../node_modules/lodash-es/_unicodeWords.js","../../../../node_modules/lodash-es/words.js","../../../../node_modules/lodash-es/_createCompounder.js","../../../../node_modules/lodash-es/camelCase.js","../../../../node_modules/lodash-es/_baseClamp.js","../../../../node_modules/lodash-es/clamp.js","../../../../node_modules/lodash-es/_stackClear.js","../../../../node_modules/lodash-es/_stackDelete.js","../../../../node_modules/lodash-es/_stackGet.js","../../../../node_modules/lodash-es/_stackHas.js","../../../../node_modules/lodash-es/_stackSet.js","../../../../node_modules/lodash-es/_Stack.js","../../../../node_modules/lodash-es/_baseAssign.js","../../../../node_modules/lodash-es/_baseAssignIn.js","../../../../node_modules/lodash-es/_cloneBuffer.js","../../../../node_modules/lodash-es/_arrayFilter.js","../../../../node_modules/lodash-es/stubArray.js","../../../../node_modules/lodash-es/_getSymbols.js","../../../../node_modules/lodash-es/_copySymbols.js","../../../../node_modules/lodash-es/_getSymbolsIn.js","../../../../node_modules/lodash-es/_copySymbolsIn.js","../../../../node_modules/lodash-es/_baseGetAllKeys.js","../../../../node_modules/lodash-es/_getAllKeys.js","../../../../node_modules/lodash-es/_getAllKeysIn.js","../../../../node_modules/lodash-es/_DataView.js","../../../../node_modules/lodash-es/_Promise.js","../../../../node_modules/lodash-es/_Set.js","../../../../node_modules/lodash-es/_getTag.js","../../../../node_modules/lodash-es/_initCloneArray.js","../../../../node_modules/lodash-es/_Uint8Array.js","../../../../node_modules/lodash-es/_cloneArrayBuffer.js","../../../../node_modules/lodash-es/_cloneDataView.js","../../../../node_modules/lodash-es/_cloneRegExp.js","../../../../node_modules/lodash-es/_cloneSymbol.js","../../../../node_modules/lodash-es/_cloneTypedArray.js","../../../../node_modules/lodash-es/_initCloneByTag.js","../../../../node_modules/lodash-es/_initCloneObject.js","../../../../node_modules/lodash-es/_baseIsMap.js","../../../../node_modules/lodash-es/isMap.js","../../../../node_modules/lodash-es/_baseIsSet.js","../../../../node_modules/lodash-es/isSet.js","../../../../node_modules/lodash-es/_baseClone.js","../../../../node_modules/lodash-es/cloneDeep.js","../../../../node_modules/lodash-es/_setCacheAdd.js","../../../../node_modules/lodash-es/_setCacheHas.js","../../../../node_modules/lodash-es/_SetCache.js","../../../../node_modules/lodash-es/_arraySome.js","../../../../node_modules/lodash-es/_cacheHas.js","../../../../node_modules/lodash-es/_equalArrays.js","../../../../node_modules/lodash-es/_mapToArray.js","../../../../node_modules/lodash-es/_setToArray.js","../../../../node_modules/lodash-es/_equalByTag.js","../../../../node_modules/lodash-es/_equalObjects.js","../../../../node_modules/lodash-es/_baseIsEqualDeep.js","../../../../node_modules/lodash-es/_baseIsEqual.js","../../../../node_modules/lodash-es/_baseIsMatch.js","../../../../node_modules/lodash-es/_isStrictComparable.js","../../../../node_modules/lodash-es/_getMatchData.js","../../../../node_modules/lodash-es/_matchesStrictComparable.js","../../../../node_modules/lodash-es/_baseMatches.js","../../../../node_modules/lodash-es/_baseHasIn.js","../../../../node_modules/lodash-es/_hasPath.js","../../../../node_modules/lodash-es/hasIn.js","../../../../node_modules/lodash-es/_baseMatchesProperty.js","../../../../node_modules/lodash-es/_baseProperty.js","../../../../node_modules/lodash-es/_basePropertyDeep.js","../../../../node_modules/lodash-es/property.js","../../../../node_modules/lodash-es/_baseIteratee.js","../../../../node_modules/lodash-es/_arrayAggregator.js","../../../../node_modules/lodash-es/_createBaseFor.js","../../../../node_modules/lodash-es/_baseFor.js","../../../../node_modules/lodash-es/_baseForOwn.js","../../../../node_modules/lodash-es/_createBaseEach.js","../../../../node_modules/lodash-es/_baseEach.js","../../../../node_modules/lodash-es/_baseAggregator.js","../../../../node_modules/lodash-es/_createAggregator.js","../../../../node_modules/lodash-es/now.js","../../../../node_modules/lodash-es/debounce.js","../../../../node_modules/lodash-es/_assignMergeValue.js","../../../../node_modules/lodash-es/isArrayLikeObject.js","../../../../node_modules/lodash-es/_safeGet.js","../../../../node_modules/lodash-es/toPlainObject.js","../../../../node_modules/lodash-es/_baseMergeDeep.js","../../../../node_modules/lodash-es/_baseMerge.js","../../../../node_modules/lodash-es/_arrayIncludesWith.js","../../../../node_modules/lodash-es/last.js","../../../../node_modules/lodash-es/_baseMap.js","../../../../node_modules/lodash-es/map.js","../../../../node_modules/lodash-es/flatMapDeep.js","../../../../node_modules/lodash-es/fromPairs.js","../../../../node_modules/lodash-es/groupBy.js","../../../../node_modules/lodash-es/isEmpty.js","../../../../node_modules/lodash-es/isEqual.js","../../../../node_modules/lodash-es/kebabCase.js","../../../../node_modules/lodash-es/merge.js","../../../../node_modules/lodash-es/_baseSome.js","../../../../node_modules/lodash-es/some.js","../../../../node_modules/lodash-es/_createSet.js","../../../../node_modules/lodash-es/_baseUniq.js","../../../../node_modules/lodash-es/unionBy.js","../../../../node_modules/lodash-es/uniq.js","../../src/interfaces/events.ts","../../src/interfaces/enums.ts","../../src/configuration-non-customizable.ts","../../src/tools.ts","../../../../node_modules/date-fns/toDate.mjs","../../../../node_modules/date-fns/constructFrom.mjs","../../../../node_modules/date-fns/addDays.mjs","../../../../node_modules/date-fns/addMonths.mjs","../../../../node_modules/date-fns/addMilliseconds.mjs","../../../../node_modules/date-fns/constants.mjs","../../../../node_modules/date-fns/addHours.mjs","../../../../node_modules/date-fns/_lib/defaultOptions.mjs","../../../../node_modules/date-fns/startOfWeek.mjs","../../../../node_modules/date-fns/startOfISOWeek.mjs","../../../../node_modules/date-fns/getISOWeekYear.mjs","../../../../node_modules/date-fns/startOfDay.mjs","../../../../node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs","../../../../node_modules/date-fns/differenceInCalendarDays.mjs","../../../../node_modules/date-fns/startOfISOWeekYear.mjs","../../../../node_modules/date-fns/addMinutes.mjs","../../../../node_modules/date-fns/addSeconds.mjs","../../../../node_modules/date-fns/addYears.mjs","../../../../node_modules/date-fns/compareAsc.mjs","../../../../node_modules/date-fns/isDate.mjs","../../../../node_modules/date-fns/isValid.mjs","../../../../node_modules/date-fns/differenceInCalendarMonths.mjs","../../../../node_modules/date-fns/differenceInCalendarYears.mjs","../../../../node_modules/date-fns/differenceInDays.mjs","../../../../node_modules/date-fns/_lib/getRoundingMethod.mjs","../../../../node_modules/date-fns/differenceInMilliseconds.mjs","../../../../node_modules/date-fns/differenceInHours.mjs","../../../../node_modules/date-fns/differenceInMinutes.mjs","../../../../node_modules/date-fns/endOfDay.mjs","../../../../node_modules/date-fns/endOfMonth.mjs","../../../../node_modules/date-fns/isLastDayOfMonth.mjs","../../../../node_modules/date-fns/differenceInMonths.mjs","../../../../node_modules/date-fns/differenceInSeconds.mjs","../../../../node_modules/date-fns/differenceInYears.mjs","../../../../node_modules/date-fns/startOfYear.mjs","../../../../node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs","../../../../node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs","../../../../node_modules/date-fns/locale/en-US/_lib/formatLong.mjs","../../../../node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs","../../../../node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs","../../../../node_modules/date-fns/locale/en-US/_lib/localize.mjs","../../../../node_modules/date-fns/locale/_lib/buildMatchFn.mjs","../../../../node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs","../../../../node_modules/date-fns/locale/en-US/_lib/match.mjs","../../../../node_modules/date-fns/locale/en-US.mjs","../../../../node_modules/date-fns/getDayOfYear.mjs","../../../../node_modules/date-fns/getISOWeek.mjs","../../../../node_modules/date-fns/getWeekYear.mjs","../../../../node_modules/date-fns/startOfWeekYear.mjs","../../../../node_modules/date-fns/getWeek.mjs","../../../../node_modules/date-fns/_lib/addLeadingZeros.mjs","../../../../node_modules/date-fns/_lib/format/lightFormatters.mjs","../../../../node_modules/date-fns/_lib/format/formatters.mjs","../../../../node_modules/date-fns/_lib/format/longFormatters.mjs","../../../../node_modules/date-fns/_lib/protectedTokens.mjs","../../../../node_modules/date-fns/format.mjs","../../../../node_modules/date-fns/subDays.mjs","../../../../node_modules/date-fns/subMonths.mjs","../../../../node_modules/date-fns/subHours.mjs","../../../../node_modules/date-fns/subMinutes.mjs","../../../../node_modules/date-fns/subSeconds.mjs","../../../../node_modules/date-fns/subYears.mjs","../../src/configuration.ts","../../src/interfaces/axis-scales.ts","../../src/services/time-series.ts","../../src/model/model.ts","../../../../node_modules/html-to-image/es/util.js","../../../../node_modules/html-to-image/es/clone-pseudos.js","../../../../node_modules/html-to-image/es/mimes.js","../../../../node_modules/html-to-image/es/dataurl.js","../../../../node_modules/html-to-image/es/clone-node.js","../../../../node_modules/html-to-image/es/embed-resources.js","../../../../node_modules/html-to-image/es/embed-images.js","../../../../node_modules/html-to-image/es/apply-style.js","../../../../node_modules/html-to-image/es/embed-webfonts.js","../../../../node_modules/html-to-image/es/index.js","../../src/services/service.ts","../../src/services/essentials/dom-utils.ts","../../src/components/component.ts","../../../../node_modules/dompurify/dist/purify.es.mjs","../../src/utils/sanitizeHtml.ts","../../src/components/axes/toolbar.ts","../../src/components/layout/layout.ts","../../src/components/layout/spacer.ts","../../../../node_modules/carbon-components/es/globals/js/settings.js","../../../../node_modules/carbon-components/es/globals/js/misc/mixin.js","../../../../node_modules/carbon-components/es/globals/js/mixins/create-component.js","../../../../node_modules/carbon-components/es/globals/js/mixins/handles.js","../../../../node_modules/carbon-components/es/globals/js/misc/on.js","../../../../node_modules/carbon-components/es/globals/js/mixins/evented-state.js","../../../../node_modules/carbon-components/es/globals/js/misc/event-matches.js","../../../../node_modules/carbon-components/es/globals/js/misc/get-launching-details.js","../../../../node_modules/carbon-components/es/globals/js/mixins/evented-show-hide-state.js","../../../../node_modules/carbon-components/es/globals/js/mixins/init-component-by-launcher.js","../../../../node_modules/carbon-components/es/components/modal/modal.js","../../src/components/essentials/modal.ts","../../src/components/essentials/title.ts","../../src/interfaces/a11y.ts","../../src/components/essentials/legend.ts","../../src/components/axes/chart-clip.ts","../../src/components/essentials/canvas-chart-clip.ts","../../../../node_modules/@carbon/utils-position/index.js","../../src/components/essentials/tooltip.ts","../../src/services/canvas-zoom.ts","../../src/services/essentials/events.ts","../../src/services/essentials/files.ts","../../src/services/essentials/gradient-utils.ts","../../src/services/essentials/transitions.ts","../../src/chart.ts","../../src/model/cartesian-charts.ts","../../src/model/alluvial.ts","../../../../node_modules/d3-sankey/node_modules/d3-array/src/max.js","../../../../node_modules/d3-sankey/node_modules/d3-array/src/min.js","../../../../node_modules/d3-sankey/node_modules/d3-array/src/sum.js","../../../../node_modules/d3-sankey/src/align.js","../../../../node_modules/d3-sankey/src/constant.js","../../../../node_modules/d3-sankey/src/sankey.js","../../../../node_modules/d3-shape/node_modules/d3-path/src/path.js","../../../../node_modules/d3-shape/src/constant.js","../../../../node_modules/d3-shape/src/point.js","../../../../node_modules/d3-shape/src/array.js","../../../../node_modules/d3-shape/src/link/index.js","../../../../node_modules/d3-sankey/src/sankeyLinkHorizontal.js","../../src/components/graphs/alluvial.ts","../../src/charts/alluvial.ts","../../src/components/axes/grid-brush.ts","../../src/components/axes/zoom-bar.ts","../../src/components/essentials/threshold.ts","../../src/components/essentials/highlights.ts","../../src/components/essentials/tooltip-axis.ts","../../src/services/scales-cartesian.ts","../../src/services/curves.ts","../../src/services/zoom.ts","../../src/axis-chart.ts","../../src/components/axes/grid.ts","../../src/components/graphs/area.ts","../../src/components/graphs/line.ts","../../src/components/axes/ruler.ts","../../src/components/graphs/scatter.ts","../../src/components/axes/axis.ts","../../src/components/axes/hover-axis.ts","../../src/components/axes/two-dimensional-axes.ts","../../src/components/graphs/skeleton.ts","../../src/charts/area.ts","../../src/model/boxplot.ts","../../src/components/graphs/boxplot.ts","../../src/components/axes/zero-line.ts","../../src/charts/boxplot.ts","../../src/components/graphs/bubble.ts","../../src/charts/bubble.ts","../../src/model/bullet.ts","../../src/components/graphs/bullet.ts","../../src/charts/bullet.ts","../../src/services/color-scale-utils.ts","../../src/model/choropleth.ts","../../../../node_modules/topojson-client/src/identity.js","../../../../node_modules/topojson-client/src/transform.js","../../../../node_modules/topojson-client/src/reverse.js","../../../../node_modules/topojson-client/src/feature.js","../../../../node_modules/topojson-client/src/stitch.js","../../../../node_modules/topojson-client/src/merge.js","../../src/components/axes/ruler-binned.ts","../../src/components/axes/ruler-stacked.ts","../../src/components/essentials/color-scale-legend.ts","../../src/components/essentials/title-meter.ts","../../src/components/graphs/bar.ts","../../src/components/graphs/circle-pack.ts","../../src/components/graphs/pie.ts","../../src/components/graphs/donut.ts","../../src/components/graphs/gauge.ts","../../src/components/graphs/bar-grouped.ts","../../src/components/graphs/heatmap.ts","../../src/components/graphs/histogram.ts","../../src/components/graphs/lollipop.ts","../../src/components/graphs/meter.ts","../../src/services/angle-utils.ts","../../src/components/graphs/radar.ts","../../src/components/graphs/bar-simple.ts","../../src/components/graphs/skeleton-lines.ts","../../src/components/graphs/area-stacked.ts","../../src/components/graphs/bar-stacked.ts","../../src/components/graphs/scatter-stacked.ts","../../src/components/graphs/tree.ts","../../../../node_modules/@carbon/colors/es/index.js","../../src/components/graphs/treemap.ts","../../../../node_modules/d3-cloud/node_modules/d3-dispatch/src/dispatch.js","../../../../node_modules/d3-cloud/index.js","../../src/components/graphs/wordcloud.ts","../../src/components/essentials/geo-projection.ts","../../src/components/graphs/choropleth.ts","../../src/charts/choropleth.ts","../../src/model/circle-pack.ts","../../src/charts/circle-pack.ts","../../src/charts/combo.ts","../../src/model/pie.ts","../../src/charts/pie.ts","../../src/charts/donut.ts","../../src/model/gauge.ts","../../src/charts/gauge.ts","../../src/charts/bar-grouped.ts","../../src/model/heatmap.ts","../../src/charts/heatmap.ts","../../src/model/binned-charts.ts","../../src/charts/histogram.ts","../../src/charts/line.ts","../../src/charts/lollipop.ts","../../src/model/meter.ts","../../src/charts/meter.ts","../../src/model/radar.ts","../../src/charts/radar.ts","../../src/charts/scatter.ts","../../src/model/tree.ts","../../src/charts/tree.ts","../../src/model/treemap.ts","../../src/charts/treemap.ts","../../src/charts/bar-simple.ts","../../src/charts/area-stacked.ts","../../src/charts/bar-stacked.ts","../../src/model/wordcloud.ts","../../src/charts/wordcloud.ts"],"sourcesContent":["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 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 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","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 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","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 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","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(x) {\n return x;\n}\n","import identity from \"./identity.js\";\n\nvar top = 1,\n right = 2,\n bottom = 3,\n left = 4,\n epsilon = 1e-6;\n\nfunction translateX(x) {\n return \"translate(\" + x + \",0)\";\n}\n\nfunction translateY(y) {\n return \"translate(0,\" + y + \")\";\n}\n\nfunction number(scale) {\n return d => +scale(d);\n}\n\nfunction center(scale, offset) {\n offset = Math.max(0, scale.bandwidth() - offset * 2) / 2;\n if (scale.round()) offset = Math.round(offset);\n return d => +scale(d) + offset;\n}\n\nfunction entering() {\n return !this.__axis;\n}\n\nfunction axis(orient, scale) {\n var tickArguments = [],\n tickValues = null,\n tickFormat = null,\n tickSizeInner = 6,\n tickSizeOuter = 6,\n tickPadding = 3,\n offset = typeof window !== \"undefined\" && window.devicePixelRatio > 1 ? 0 : 0.5,\n k = orient === top || orient === left ? -1 : 1,\n x = orient === left || orient === right ? \"x\" : \"y\",\n transform = orient === top || orient === bottom ? translateX : translateY;\n\n function axis(context) {\n var values = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()) : tickValues,\n format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity) : tickFormat,\n spacing = Math.max(tickSizeInner, 0) + tickPadding,\n range = scale.range(),\n range0 = +range[0] + offset,\n range1 = +range[range.length - 1] + offset,\n position = (scale.bandwidth ? center : number)(scale.copy(), offset),\n selection = context.selection ? context.selection() : context,\n path = selection.selectAll(\".domain\").data([null]),\n tick = selection.selectAll(\".tick\").data(values, scale).order(),\n tickExit = tick.exit(),\n tickEnter = tick.enter().append(\"g\").attr(\"class\", \"tick\"),\n line = tick.select(\"line\"),\n text = tick.select(\"text\");\n\n path = path.merge(path.enter().insert(\"path\", \".tick\")\n .attr(\"class\", \"domain\")\n .attr(\"stroke\", \"currentColor\"));\n\n tick = tick.merge(tickEnter);\n\n line = line.merge(tickEnter.append(\"line\")\n .attr(\"stroke\", \"currentColor\")\n .attr(x + \"2\", k * tickSizeInner));\n\n text = text.merge(tickEnter.append(\"text\")\n .attr(\"fill\", \"currentColor\")\n .attr(x, k * spacing)\n .attr(\"dy\", orient === top ? \"0em\" : orient === bottom ? \"0.71em\" : \"0.32em\"));\n\n if (context !== selection) {\n path = path.transition(context);\n tick = tick.transition(context);\n line = line.transition(context);\n text = text.transition(context);\n\n tickExit = tickExit.transition(context)\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { return isFinite(d = position(d)) ? transform(d + offset) : this.getAttribute(\"transform\"); });\n\n tickEnter\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { var p = this.parentNode.__axis; return transform((p && isFinite(p = p(d)) ? p : position(d)) + offset); });\n }\n\n tickExit.remove();\n\n path\n .attr(\"d\", orient === left || orient === right\n ? (tickSizeOuter ? \"M\" + k * tickSizeOuter + \",\" + range0 + \"H\" + offset + \"V\" + range1 + \"H\" + k * tickSizeOuter : \"M\" + offset + \",\" + range0 + \"V\" + range1)\n : (tickSizeOuter ? \"M\" + range0 + \",\" + k * tickSizeOuter + \"V\" + offset + \"H\" + range1 + \"V\" + k * tickSizeOuter : \"M\" + range0 + \",\" + offset + \"H\" + range1));\n\n tick\n .attr(\"opacity\", 1)\n .attr(\"transform\", function(d) { return transform(position(d) + offset); });\n\n line\n .attr(x + \"2\", k * tickSizeInner);\n\n text\n .attr(x, k * spacing)\n .text(format);\n\n selection.filter(entering)\n .attr(\"fill\", \"none\")\n .attr(\"font-size\", 10)\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"text-anchor\", orient === right ? \"start\" : orient === left ? \"end\" : \"middle\");\n\n selection\n .each(function() { this.__axis = position; });\n }\n\n axis.scale = function(_) {\n return arguments.length ? (scale = _, axis) : scale;\n };\n\n axis.ticks = function() {\n return tickArguments = Array.from(arguments), axis;\n };\n\n axis.tickArguments = function(_) {\n return arguments.length ? (tickArguments = _ == null ? [] : Array.from(_), axis) : tickArguments.slice();\n };\n\n axis.tickValues = function(_) {\n return arguments.length ? (tickValues = _ == null ? null : Array.from(_), axis) : tickValues && tickValues.slice();\n };\n\n axis.tickFormat = function(_) {\n return arguments.length ? (tickFormat = _, axis) : tickFormat;\n };\n\n axis.tickSize = function(_) {\n return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeInner = function(_) {\n return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeOuter = function(_) {\n return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;\n };\n\n axis.tickPadding = function(_) {\n return arguments.length ? (tickPadding = +_, axis) : tickPadding;\n };\n\n axis.offset = function(_) {\n return arguments.length ? (offset = +_, axis) : offset;\n };\n\n return axis;\n}\n\nexport function axisTop(scale) {\n return axis(top, scale);\n}\n\nexport function axisRight(scale) {\n return axis(right, scale);\n}\n\nexport function axisBottom(scale) {\n return axis(bottom, scale);\n}\n\nexport function axisLeft(scale) {\n return axis(left, scale);\n}\n","var noop = {value: () => {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexport default dispatch;\n","export var xhtml = \"http://www.w3.org/1999/xhtml\";\n\nexport default {\n svg: \"http://www.w3.org/2000/svg\",\n xhtml: xhtml,\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\",\n xmlns: \"http://www.w3.org/2000/xmlns/\"\n};\n","import namespaces from \"./namespaces.js\";\n\nexport default function(name) {\n var prefix = name += \"\", i = prefix.indexOf(\":\");\n if (i >= 0 && (prefix = name.slice(0, i)) !== \"xmlns\") name = name.slice(i + 1);\n return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; // eslint-disable-line no-prototype-builtins\n}\n","import namespace from \"./namespace.js\";\nimport {xhtml} from \"./namespaces.js\";\n\nfunction creatorInherit(name) {\n return function() {\n var document = this.ownerDocument,\n uri = this.namespaceURI;\n return uri === xhtml && document.documentElement.namespaceURI === xhtml\n ? document.createElement(name)\n : document.createElementNS(uri, name);\n };\n}\n\nfunction creatorFixed(fullname) {\n return function() {\n return this.ownerDocument.createElementNS(fullname.space, fullname.local);\n };\n}\n\nexport default function(name) {\n var fullname = namespace(name);\n return (fullname.local\n ? creatorFixed\n : creatorInherit)(fullname);\n}\n","function none() {}\n\nexport default function(selector) {\n return selector == null ? none : function() {\n return this.querySelector(selector);\n };\n}\n","import {Selection} from \"./index.js\";\nimport selector from \"../selector.js\";\n\nexport default function(select) {\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n","// Given something array like (or null), returns something that is strictly an\n// array. This is used to ensure that array-like objects passed to d3.selectAll\n// or selection.selectAll are converted into proper arrays when creating a\n// selection; we don’t ever want to create a selection backed by a live\n// HTMLCollection or NodeList. However, note that selection.selectAll will use a\n// static NodeList as a group, since it safely derived from querySelectorAll.\nexport default function array(x) {\n return x == null ? [] : Array.isArray(x) ? x : Array.from(x);\n}\n","function empty() {\n return [];\n}\n\nexport default function(selector) {\n return selector == null ? empty : function() {\n return this.querySelectorAll(selector);\n };\n}\n","import {Selection} from \"./index.js\";\nimport array from \"../array.js\";\nimport selectorAll from \"../selectorAll.js\";\n\nfunction arrayAll(select) {\n return function() {\n return array(select.apply(this, arguments));\n };\n}\n\nexport default function(select) {\n if (typeof select === \"function\") select = arrayAll(select);\n else select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n subgroups.push(select.call(node, node.__data__, i, group));\n parents.push(node);\n }\n }\n }\n\n return new Selection(subgroups, parents);\n}\n","export default function(selector) {\n return function() {\n return this.matches(selector);\n };\n}\n\nexport function childMatcher(selector) {\n return function(node) {\n return node.matches(selector);\n };\n}\n\n","import {childMatcher} from \"../matcher.js\";\n\nvar find = Array.prototype.find;\n\nfunction childFind(match) {\n return function() {\n return find.call(this.children, match);\n };\n}\n\nfunction childFirst() {\n return this.firstElementChild;\n}\n\nexport default function(match) {\n return this.select(match == null ? childFirst\n : childFind(typeof match === \"function\" ? match : childMatcher(match)));\n}\n","import {childMatcher} from \"../matcher.js\";\n\nvar filter = Array.prototype.filter;\n\nfunction children() {\n return Array.from(this.children);\n}\n\nfunction childrenFilter(match) {\n return function() {\n return filter.call(this.children, match);\n };\n}\n\nexport default function(match) {\n return this.selectAll(match == null ? children\n : childrenFilter(typeof match === \"function\" ? match : childMatcher(match)));\n}\n","import {Selection} from \"./index.js\";\nimport matcher from \"../matcher.js\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n","export default function(update) {\n return new Array(update.length);\n}\n","import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n return new Selection(this._enter || this._groups.map(sparse), this._parents);\n}\n\nexport function EnterNode(parent, datum) {\n this.ownerDocument = parent.ownerDocument;\n this.namespaceURI = parent.namespaceURI;\n this._next = null;\n this._parent = parent;\n this.__data__ = datum;\n}\n\nEnterNode.prototype = {\n constructor: EnterNode,\n appendChild: function(child) { return this._parent.insertBefore(child, this._next); },\n insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },\n querySelector: function(selector) { return this._parent.querySelector(selector); },\n querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }\n};\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","import {Selection} from \"./index.js\";\nimport {EnterNode} from \"./enter.js\";\nimport constant from \"../constant.js\";\n\nfunction bindIndex(parent, group, enter, update, exit, data) {\n var i = 0,\n node,\n groupLength = group.length,\n dataLength = data.length;\n\n // Put any non-null nodes that fit into update.\n // Put any null nodes into enter.\n // Put any remaining data into enter.\n for (; i < dataLength; ++i) {\n if (node = group[i]) {\n node.__data__ = data[i];\n update[i] = node;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Put any non-null nodes that don’t fit into exit.\n for (; i < groupLength; ++i) {\n if (node = group[i]) {\n exit[i] = node;\n }\n }\n}\n\nfunction bindKey(parent, group, enter, update, exit, data, key) {\n var i,\n node,\n nodeByKeyValue = new Map,\n groupLength = group.length,\n dataLength = data.length,\n keyValues = new Array(groupLength),\n keyValue;\n\n // Compute the key for each node.\n // If multiple nodes have the same key, the duplicates are added to exit.\n for (i = 0; i < groupLength; ++i) {\n if (node = group[i]) {\n keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + \"\";\n if (nodeByKeyValue.has(keyValue)) {\n exit[i] = node;\n } else {\n nodeByKeyValue.set(keyValue, node);\n }\n }\n }\n\n // Compute the key for each datum.\n // If there a node associated with this key, join and add it to update.\n // If there is not (or the key is a duplicate), add it to enter.\n for (i = 0; i < dataLength; ++i) {\n keyValue = key.call(parent, data[i], i, data) + \"\";\n if (node = nodeByKeyValue.get(keyValue)) {\n update[i] = node;\n node.__data__ = data[i];\n nodeByKeyValue.delete(keyValue);\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Add any remaining nodes that were not bound to data to exit.\n for (i = 0; i < groupLength; ++i) {\n if ((node = group[i]) && (nodeByKeyValue.get(keyValues[i]) === node)) {\n exit[i] = node;\n }\n }\n}\n\nfunction datum(node) {\n return node.__data__;\n}\n\nexport default function(value, key) {\n if (!arguments.length) return Array.from(this, datum);\n\n var bind = key ? bindKey : bindIndex,\n parents = this._parents,\n groups = this._groups;\n\n if (typeof value !== \"function\") value = constant(value);\n\n for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {\n var parent = parents[j],\n group = groups[j],\n groupLength = group.length,\n data = arraylike(value.call(parent, parent && parent.__data__, j, parents)),\n dataLength = data.length,\n enterGroup = enter[j] = new Array(dataLength),\n updateGroup = update[j] = new Array(dataLength),\n exitGroup = exit[j] = new Array(groupLength);\n\n bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);\n\n // Now connect the enter nodes to their following update node, such that\n // appendChild can insert the materialized enter node before this node,\n // rather than at the end of the parent node.\n for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {\n if (previous = enterGroup[i0]) {\n if (i0 >= i1) i1 = i0 + 1;\n while (!(next = updateGroup[i1]) && ++i1 < dataLength);\n previous._next = next || null;\n }\n }\n }\n\n update = new Selection(update, parents);\n update._enter = enter;\n update._exit = exit;\n return update;\n}\n\n// Given some data, this returns an array-like view of it: an object that\n// exposes a length property and allows numeric indexing. Note that unlike\n// selectAll, this isn’t worried about “live” collections because the resulting\n// array will only be used briefly while data is being bound. (It is possible to\n// cause the data to change while iterating by using a key function, but please\n// don’t; we’d rather avoid a gratuitous copy.)\nfunction arraylike(data) {\n return typeof data === \"object\" && \"length\" in data\n ? data // Array, TypedArray, NodeList, array-like\n : Array.from(data); // Map, Set, iterable, string, or anything else\n}\n","import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n return new Selection(this._exit || this._groups.map(sparse), this._parents);\n}\n","export default function(onenter, onupdate, onexit) {\n var enter = this.enter(), update = this, exit = this.exit();\n if (typeof onenter === \"function\") {\n enter = onenter(enter);\n if (enter) enter = enter.selection();\n } else {\n enter = enter.append(onenter + \"\");\n }\n if (onupdate != null) {\n update = onupdate(update);\n if (update) update = update.selection();\n }\n if (onexit == null) exit.remove(); else onexit(exit);\n return enter && update ? enter.merge(update).order() : update;\n}\n","import {Selection} from \"./index.js\";\n\nexport default function(context) {\n var selection = context.selection ? context.selection() : context;\n\n for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Selection(merges, this._parents);\n}\n","export default function() {\n\n for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {\n for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {\n if (node = group[i]) {\n if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);\n next = node;\n }\n }\n }\n\n return this;\n}\n","import {Selection} from \"./index.js\";\n\nexport default function(compare) {\n if (!compare) compare = ascending;\n\n function compareNode(a, b) {\n return a && b ? compare(a.__data__, b.__data__) : !a - !b;\n }\n\n for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n sortgroup[i] = node;\n }\n }\n sortgroup.sort(compareNode);\n }\n\n return new Selection(sortgroups, this._parents).order();\n}\n\nfunction ascending(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function() {\n var callback = arguments[0];\n arguments[0] = this;\n callback.apply(null, arguments);\n return this;\n}\n","export default function() {\n return Array.from(this);\n}\n","export default function() {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {\n var node = group[i];\n if (node) return node;\n }\n }\n\n return null;\n}\n","export default function() {\n let size = 0;\n for (const node of this) ++size; // eslint-disable-line no-unused-vars\n return size;\n}\n","export default function() {\n return !this.node();\n}\n","export default function(callback) {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) callback.call(node, node.__data__, i, group);\n }\n }\n\n return this;\n}\n","import namespace from \"../namespace.js\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, value) {\n return function() {\n this.setAttribute(name, value);\n };\n}\n\nfunction attrConstantNS(fullname, value) {\n return function() {\n this.setAttributeNS(fullname.space, fullname.local, value);\n };\n}\n\nfunction attrFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttribute(name);\n else this.setAttribute(name, v);\n };\n}\n\nfunction attrFunctionNS(fullname, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttributeNS(fullname.space, fullname.local);\n else this.setAttributeNS(fullname.space, fullname.local, v);\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name);\n\n if (arguments.length < 2) {\n var node = this.node();\n return fullname.local\n ? node.getAttributeNS(fullname.space, fullname.local)\n : node.getAttribute(fullname);\n }\n\n return this.each((value == null\n ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)\n : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));\n}\n","export default function(node) {\n return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node\n || (node.document && node) // node is a Window\n || node.defaultView; // node is a Document\n}\n","import defaultView from \"../window.js\";\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, value, priority) {\n return function() {\n this.style.setProperty(name, value, priority);\n };\n}\n\nfunction styleFunction(name, value, priority) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.style.removeProperty(name);\n else this.style.setProperty(name, v, priority);\n };\n}\n\nexport default function(name, value, priority) {\n return arguments.length > 1\n ? this.each((value == null\n ? styleRemove : typeof value === \"function\"\n ? styleFunction\n : styleConstant)(name, value, priority == null ? \"\" : priority))\n : styleValue(this.node(), name);\n}\n\nexport function styleValue(node, name) {\n return node.style.getPropertyValue(name)\n || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);\n}\n","function propertyRemove(name) {\n return function() {\n delete this[name];\n };\n}\n\nfunction propertyConstant(name, value) {\n return function() {\n this[name] = value;\n };\n}\n\nfunction propertyFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) delete this[name];\n else this[name] = v;\n };\n}\n\nexport default function(name, value) {\n return arguments.length > 1\n ? this.each((value == null\n ? propertyRemove : typeof value === \"function\"\n ? propertyFunction\n : propertyConstant)(name, value))\n : this.node()[name];\n}\n","function classArray(string) {\n return string.trim().split(/^|\\s+/);\n}\n\nfunction classList(node) {\n return node.classList || new ClassList(node);\n}\n\nfunction ClassList(node) {\n this._node = node;\n this._names = classArray(node.getAttribute(\"class\") || \"\");\n}\n\nClassList.prototype = {\n add: function(name) {\n var i = this._names.indexOf(name);\n if (i < 0) {\n this._names.push(name);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n remove: function(name) {\n var i = this._names.indexOf(name);\n if (i >= 0) {\n this._names.splice(i, 1);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n contains: function(name) {\n return this._names.indexOf(name) >= 0;\n }\n};\n\nfunction classedAdd(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.add(names[i]);\n}\n\nfunction classedRemove(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.remove(names[i]);\n}\n\nfunction classedTrue(names) {\n return function() {\n classedAdd(this, names);\n };\n}\n\nfunction classedFalse(names) {\n return function() {\n classedRemove(this, names);\n };\n}\n\nfunction classedFunction(names, value) {\n return function() {\n (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);\n };\n}\n\nexport default function(name, value) {\n var names = classArray(name + \"\");\n\n if (arguments.length < 2) {\n var list = classList(this.node()), i = -1, n = names.length;\n while (++i < n) if (!list.contains(names[i])) return false;\n return true;\n }\n\n return this.each((typeof value === \"function\"\n ? classedFunction : value\n ? classedTrue\n : classedFalse)(names, value));\n}\n","function textRemove() {\n this.textContent = \"\";\n}\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.textContent = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? textRemove : (typeof value === \"function\"\n ? textFunction\n : textConstant)(value))\n : this.node().textContent;\n}\n","function htmlRemove() {\n this.innerHTML = \"\";\n}\n\nfunction htmlConstant(value) {\n return function() {\n this.innerHTML = value;\n };\n}\n\nfunction htmlFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.innerHTML = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? htmlRemove : (typeof value === \"function\"\n ? htmlFunction\n : htmlConstant)(value))\n : this.node().innerHTML;\n}\n","function raise() {\n if (this.nextSibling) this.parentNode.appendChild(this);\n}\n\nexport default function() {\n return this.each(raise);\n}\n","function lower() {\n if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);\n}\n\nexport default function() {\n return this.each(lower);\n}\n","import creator from \"../creator.js\";\n\nexport default function(name) {\n var create = typeof name === \"function\" ? name : creator(name);\n return this.select(function() {\n return this.appendChild(create.apply(this, arguments));\n });\n}\n","import creator from \"../creator.js\";\nimport selector from \"../selector.js\";\n\nfunction constantNull() {\n return null;\n}\n\nexport default function(name, before) {\n var create = typeof name === \"function\" ? name : creator(name),\n select = before == null ? constantNull : typeof before === \"function\" ? before : selector(before);\n return this.select(function() {\n return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);\n });\n}\n","function remove() {\n var parent = this.parentNode;\n if (parent) parent.removeChild(this);\n}\n\nexport default function() {\n return this.each(remove);\n}\n","function selection_cloneShallow() {\n var clone = this.cloneNode(false), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nfunction selection_cloneDeep() {\n var clone = this.cloneNode(true), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nexport default function(deep) {\n return this.select(deep ? selection_cloneDeep : selection_cloneShallow);\n}\n","export default function(value) {\n return arguments.length\n ? this.property(\"__data__\", value)\n : this.node().__data__;\n}\n","function contextListener(listener) {\n return function(event) {\n listener.call(this, event, this.__data__);\n };\n}\n\nfunction parseTypenames(typenames) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n return {type: t, name: name};\n });\n}\n\nfunction onRemove(typename) {\n return function() {\n var on = this.__on;\n if (!on) return;\n for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {\n if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.options);\n } else {\n on[++i] = o;\n }\n }\n if (++i) on.length = i;\n else delete this.__on;\n };\n}\n\nfunction onAdd(typename, value, options) {\n return function() {\n var on = this.__on, o, listener = contextListener(value);\n if (on) for (var j = 0, m = on.length; j < m; ++j) {\n if ((o = on[j]).type === typename.type && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.options);\n this.addEventListener(o.type, o.listener = listener, o.options = options);\n o.value = value;\n return;\n }\n }\n this.addEventListener(typename.type, listener, options);\n o = {type: typename.type, name: typename.name, value: value, listener: listener, options: options};\n if (!on) this.__on = [o];\n else on.push(o);\n };\n}\n\nexport default function(typename, value, options) {\n var typenames = parseTypenames(typename + \"\"), i, n = typenames.length, t;\n\n if (arguments.length < 2) {\n var on = this.node().__on;\n if (on) for (var j = 0, m = on.length, o; j < m; ++j) {\n for (i = 0, o = on[j]; i < n; ++i) {\n if ((t = typenames[i]).type === o.type && t.name === o.name) {\n return o.value;\n }\n }\n }\n return;\n }\n\n on = value ? onAdd : onRemove;\n for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options));\n return this;\n}\n","import defaultView from \"../window.js\";\n\nfunction dispatchEvent(node, type, params) {\n var window = defaultView(node),\n event = window.CustomEvent;\n\n if (typeof event === \"function\") {\n event = new event(type, params);\n } else {\n event = window.document.createEvent(\"Event\");\n if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;\n else event.initEvent(type, false, false);\n }\n\n node.dispatchEvent(event);\n}\n\nfunction dispatchConstant(type, params) {\n return function() {\n return dispatchEvent(this, type, params);\n };\n}\n\nfunction dispatchFunction(type, params) {\n return function() {\n return dispatchEvent(this, type, params.apply(this, arguments));\n };\n}\n\nexport default function(type, params) {\n return this.each((typeof params === \"function\"\n ? dispatchFunction\n : dispatchConstant)(type, params));\n}\n","export default function*() {\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) yield node;\n }\n }\n}\n","import selection_select from \"./select.js\";\nimport selection_selectAll from \"./selectAll.js\";\nimport selection_selectChild from \"./selectChild.js\";\nimport selection_selectChildren from \"./selectChildren.js\";\nimport selection_filter from \"./filter.js\";\nimport selection_data from \"./data.js\";\nimport selection_enter from \"./enter.js\";\nimport selection_exit from \"./exit.js\";\nimport selection_join from \"./join.js\";\nimport selection_merge from \"./merge.js\";\nimport selection_order from \"./order.js\";\nimport selection_sort from \"./sort.js\";\nimport selection_call from \"./call.js\";\nimport selection_nodes from \"./nodes.js\";\nimport selection_node from \"./node.js\";\nimport selection_size from \"./size.js\";\nimport selection_empty from \"./empty.js\";\nimport selection_each from \"./each.js\";\nimport selection_attr from \"./attr.js\";\nimport selection_style from \"./style.js\";\nimport selection_property from \"./property.js\";\nimport selection_classed from \"./classed.js\";\nimport selection_text from \"./text.js\";\nimport selection_html from \"./html.js\";\nimport selection_raise from \"./raise.js\";\nimport selection_lower from \"./lower.js\";\nimport selection_append from \"./append.js\";\nimport selection_insert from \"./insert.js\";\nimport selection_remove from \"./remove.js\";\nimport selection_clone from \"./clone.js\";\nimport selection_datum from \"./datum.js\";\nimport selection_on from \"./on.js\";\nimport selection_dispatch from \"./dispatch.js\";\nimport selection_iterator from \"./iterator.js\";\n\nexport var root = [null];\n\nexport function Selection(groups, parents) {\n this._groups = groups;\n this._parents = parents;\n}\n\nfunction selection() {\n return new Selection([[document.documentElement]], root);\n}\n\nfunction selection_selection() {\n return this;\n}\n\nSelection.prototype = selection.prototype = {\n constructor: Selection,\n select: selection_select,\n selectAll: selection_selectAll,\n selectChild: selection_selectChild,\n selectChildren: selection_selectChildren,\n filter: selection_filter,\n data: selection_data,\n enter: selection_enter,\n exit: selection_exit,\n join: selection_join,\n merge: selection_merge,\n selection: selection_selection,\n order: selection_order,\n sort: selection_sort,\n call: selection_call,\n nodes: selection_nodes,\n node: selection_node,\n size: selection_size,\n empty: selection_empty,\n each: selection_each,\n attr: selection_attr,\n style: selection_style,\n property: selection_property,\n classed: selection_classed,\n text: selection_text,\n html: selection_html,\n raise: selection_raise,\n lower: selection_lower,\n append: selection_append,\n insert: selection_insert,\n remove: selection_remove,\n clone: selection_clone,\n datum: selection_datum,\n on: selection_on,\n dispatch: selection_dispatch,\n [Symbol.iterator]: selection_iterator\n};\n\nexport default selection;\n","import {Selection, root} from \"./selection/index.js\";\n\nexport default function(selector) {\n return typeof selector === \"string\"\n ? new Selection([[document.querySelector(selector)]], [document.documentElement])\n : new Selection([[selector]], root);\n}\n","export default function(event) {\n let sourceEvent;\n while (sourceEvent = event.sourceEvent) event = sourceEvent;\n return event;\n}\n","import sourceEvent from \"./sourceEvent.js\";\n\nexport default function(event, node) {\n event = sourceEvent(event);\n if (node === undefined) node = event.currentTarget;\n if (node) {\n var svg = node.ownerSVGElement || node;\n if (svg.createSVGPoint) {\n var point = svg.createSVGPoint();\n point.x = event.clientX, point.y = event.clientY;\n point = point.matrixTransform(node.getScreenCTM().inverse());\n return [point.x, point.y];\n }\n if (node.getBoundingClientRect) {\n var rect = node.getBoundingClientRect();\n return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];\n }\n }\n return [event.pageX, event.pageY];\n}\n","// These are typically used in conjunction with noevent to ensure that we can\n// preventDefault on the event.\nexport const nonpassive = {passive: false};\nexport const nonpassivecapture = {capture: true, passive: false};\n\nexport function nopropagation(event) {\n event.stopImmediatePropagation();\n}\n\nexport default function(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n","import {select} from \"d3-selection\";\nimport noevent, {nonpassivecapture} from \"./noevent.js\";\n\nexport default function(view) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", noevent, nonpassivecapture);\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", noevent, nonpassivecapture);\n } else {\n root.__noselect = root.style.MozUserSelect;\n root.style.MozUserSelect = \"none\";\n }\n}\n\nexport function yesdrag(view, noclick) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", null);\n if (noclick) {\n selection.on(\"click.drag\", noevent, nonpassivecapture);\n setTimeout(function() { selection.on(\"click.drag\", null); }, 0);\n }\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", null);\n } else {\n root.style.MozUserSelect = root.__noselect;\n delete root.__noselect;\n }\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(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHex8: color_formatHex8,\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_formatHex8() {\n return this.rgb().formatHex8();\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(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(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() {\n return this;\n },\n clamp() {\n return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));\n },\n displayable() {\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 formatHex8: rgb_formatHex8,\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_formatHex8() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;\n}\n\nfunction rgb_formatRgb() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"rgb(\" : \"rgba(\"}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? \")\" : `, ${a})`}`;\n}\n\nfunction clampa(opacity) {\n return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));\n}\n\nfunction clampi(value) {\n return Math.max(0, Math.min(255, Math.round(value) || 0));\n}\n\nfunction hex(value) {\n value = clampi(value);\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(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(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() {\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 clamp() {\n return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));\n },\n displayable() {\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() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"hsl(\" : \"hsla(\"}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? \")\" : `, ${a})`}`;\n }\n}));\n\nfunction clamph(value) {\n value = (value || 0) % 360;\n return value < 0 ? value + 360 : value;\n}\n\nfunction clampt(value) {\n return Math.max(0, Math.min(1, value || 0));\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","export default x => () => x;\n","import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n","import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n","export default function(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n}\n\nexport function isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n","import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n","export default function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n","import value from \"./value.js\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n","import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n","import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : isNumberArray(b) ? numberArray\n : Array.isArray(b) ? genericArray\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n","var degrees = 180 / Math.PI;\n\nexport var identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\nexport default function(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n}\n","import decompose, {identity} from \"./decompose.js\";\n\nvar svgNode;\n\n/* eslint-disable no-undef */\nexport function parseCss(value) {\n const m = new (typeof DOMMatrix === \"function\" ? DOMMatrix : WebKitCSSMatrix)(value + \"\");\n return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);\n}\n\nexport function parseSvg(value) {\n if (value == null) return identity;\n if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svgNode.setAttribute(\"transform\", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n value = value.matrix;\n return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n","import number from \"../number.js\";\nimport {parseCss, parseSvg} from \"./parse.js\";\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + \" \" : \"\";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb || yb) {\n s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"rotate(\" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"skewX(\" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n };\n}\n\nexport var interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nexport var interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\n","export default function(interpolator, n) {\n var samples = new Array(n);\n for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));\n return samples;\n}\n","var frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nexport function Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nexport function timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nexport function timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n","import {Timer} from \"./timer.js\";\n\nexport default function(callback, delay, time) {\n var t = new Timer;\n delay = delay == null ? 0 : +delay;\n t.restart(elapsed => {\n t.stop();\n callback(elapsed + delay);\n }, delay, time);\n return t;\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {timer, timeout} from \"d3-timer\";\n\nvar emptyOn = dispatch(\"start\", \"end\", \"cancel\", \"interrupt\");\nvar emptyTween = [];\n\nexport var CREATED = 0;\nexport var SCHEDULED = 1;\nexport var STARTING = 2;\nexport var STARTED = 3;\nexport var RUNNING = 4;\nexport var ENDING = 5;\nexport var ENDED = 6;\n\nexport default function(node, name, id, index, group, timing) {\n var schedules = node.__transition;\n if (!schedules) node.__transition = {};\n else if (id in schedules) return;\n create(node, id, {\n name: name,\n index: index, // For context during callback.\n group: group, // For context during callback.\n on: emptyOn,\n tween: emptyTween,\n time: timing.time,\n delay: timing.delay,\n duration: timing.duration,\n ease: timing.ease,\n timer: null,\n state: CREATED\n });\n}\n\nexport function init(node, id) {\n var schedule = get(node, id);\n if (schedule.state > CREATED) throw new Error(\"too late; already scheduled\");\n return schedule;\n}\n\nexport function set(node, id) {\n var schedule = get(node, id);\n if (schedule.state > STARTED) throw new Error(\"too late; already running\");\n return schedule;\n}\n\nexport function get(node, id) {\n var schedule = node.__transition;\n if (!schedule || !(schedule = schedule[id])) throw new Error(\"transition not found\");\n return schedule;\n}\n\nfunction create(node, id, self) {\n var schedules = node.__transition,\n tween;\n\n // Initialize the self timer when the transition is created.\n // Note the actual delay is not known until the first callback!\n schedules[id] = self;\n self.timer = timer(schedule, 0, self.time);\n\n function schedule(elapsed) {\n self.state = SCHEDULED;\n self.timer.restart(start, self.delay, self.time);\n\n // If the elapsed delay is less than our first sleep, start immediately.\n if (self.delay <= elapsed) start(elapsed - self.delay);\n }\n\n function start(elapsed) {\n var i, j, n, o;\n\n // If the state is not SCHEDULED, then we previously errored on start.\n if (self.state !== SCHEDULED) return stop();\n\n for (i in schedules) {\n o = schedules[i];\n if (o.name !== self.name) continue;\n\n // While this element already has a starting transition during this frame,\n // defer starting an interrupting transition until that transition has a\n // chance to tick (and possibly end); see d3/d3-transition#54!\n if (o.state === STARTED) return timeout(start);\n\n // Interrupt the active transition, if any.\n if (o.state === RUNNING) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"interrupt\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n\n // Cancel any pre-empted transitions.\n else if (+i < id) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"cancel\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n }\n\n // Defer the first tick to end of the current frame; see d3/d3#1576.\n // Note the transition may be canceled after start and before the first tick!\n // Note this must be scheduled before the start event; see d3/d3-transition#16!\n // Assuming this is successful, subsequent callbacks go straight to tick.\n timeout(function() {\n if (self.state === STARTED) {\n self.state = RUNNING;\n self.timer.restart(tick, self.delay, self.time);\n tick(elapsed);\n }\n });\n\n // Dispatch the start event.\n // Note this must be done before the tween are initialized.\n self.state = STARTING;\n self.on.call(\"start\", node, node.__data__, self.index, self.group);\n if (self.state !== STARTING) return; // interrupted\n self.state = STARTED;\n\n // Initialize the tween, deleting null tween.\n tween = new Array(n = self.tween.length);\n for (i = 0, j = -1; i < n; ++i) {\n if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {\n tween[++j] = o;\n }\n }\n tween.length = j + 1;\n }\n\n function tick(elapsed) {\n var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),\n i = -1,\n n = tween.length;\n\n while (++i < n) {\n tween[i].call(node, t);\n }\n\n // Dispatch the end event.\n if (self.state === ENDING) {\n self.on.call(\"end\", node, node.__data__, self.index, self.group);\n stop();\n }\n }\n\n function stop() {\n self.state = ENDED;\n self.timer.stop();\n delete schedules[id];\n for (var i in schedules) return; // eslint-disable-line no-unused-vars\n delete node.__transition;\n }\n}\n","import {STARTING, ENDING, ENDED} from \"./transition/schedule.js\";\n\nexport default function(node, name) {\n var schedules = node.__transition,\n schedule,\n active,\n empty = true,\n i;\n\n if (!schedules) return;\n\n name = name == null ? null : name + \"\";\n\n for (i in schedules) {\n if ((schedule = schedules[i]).name !== name) { empty = false; continue; }\n active = schedule.state > STARTING && schedule.state < ENDING;\n schedule.state = ENDED;\n schedule.timer.stop();\n schedule.on.call(active ? \"interrupt\" : \"cancel\", node, node.__data__, schedule.index, schedule.group);\n delete schedules[i];\n }\n\n if (empty) delete node.__transition;\n}\n","import interrupt from \"../interrupt.js\";\n\nexport default function(name) {\n return this.each(function() {\n interrupt(this, name);\n });\n}\n","import {get, set} from \"./schedule.js\";\n\nfunction tweenRemove(id, name) {\n var tween0, tween1;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = tween0 = tween;\n for (var i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1 = tween1.slice();\n tween1.splice(i, 1);\n break;\n }\n }\n }\n\n schedule.tween = tween1;\n };\n}\n\nfunction tweenFunction(id, name, value) {\n var tween0, tween1;\n if (typeof value !== \"function\") throw new Error;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = (tween0 = tween).slice();\n for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1[i] = t;\n break;\n }\n }\n if (i === n) tween1.push(t);\n }\n\n schedule.tween = tween1;\n };\n}\n\nexport default function(name, value) {\n var id = this._id;\n\n name += \"\";\n\n if (arguments.length < 2) {\n var tween = get(this.node(), id).tween;\n for (var i = 0, n = tween.length, t; i < n; ++i) {\n if ((t = tween[i]).name === name) {\n return t.value;\n }\n }\n return null;\n }\n\n return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));\n}\n\nexport function tweenValue(transition, name, value) {\n var id = transition._id;\n\n transition.each(function() {\n var schedule = set(this, id);\n (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);\n });\n\n return function(node) {\n return get(node, id).value[name];\n };\n}\n","import {color} from \"d3-color\";\nimport {interpolateNumber, interpolateRgb, interpolateString} from \"d3-interpolate\";\n\nexport default function(a, b) {\n var c;\n return (typeof b === \"number\" ? interpolateNumber\n : b instanceof color ? interpolateRgb\n : (c = color(b)) ? (b = c, interpolateRgb)\n : interpolateString)(a, b);\n}\n","import {interpolateTransformSvg as interpolateTransform} from \"d3-interpolate\";\nimport {namespace} from \"d3-selection\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttribute(name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrConstantNS(fullname, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttributeNS(fullname.space, fullname.local);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttribute(name);\n string0 = this.getAttribute(name);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction attrFunctionNS(fullname, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);\n string0 = this.getAttributeNS(fullname.space, fullname.local);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name), i = fullname === \"transform\" ? interpolateTransform : interpolate;\n return this.attrTween(name, typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, \"attr.\" + name, value))\n : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname)\n : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));\n}\n","import {namespace} from \"d3-selection\";\n\nfunction attrInterpolate(name, i) {\n return function(t) {\n this.setAttribute(name, i.call(this, t));\n };\n}\n\nfunction attrInterpolateNS(fullname, i) {\n return function(t) {\n this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));\n };\n}\n\nfunction attrTweenNS(fullname, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nfunction attrTween(name, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value) {\n var key = \"attr.\" + name;\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n var fullname = namespace(name);\n return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));\n}\n","import {get, init} from \"./schedule.js\";\n\nfunction delayFunction(id, value) {\n return function() {\n init(this, id).delay = +value.apply(this, arguments);\n };\n}\n\nfunction delayConstant(id, value) {\n return value = +value, function() {\n init(this, id).delay = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? delayFunction\n : delayConstant)(id, value))\n : get(this.node(), id).delay;\n}\n","import {get, set} from \"./schedule.js\";\n\nfunction durationFunction(id, value) {\n return function() {\n set(this, id).duration = +value.apply(this, arguments);\n };\n}\n\nfunction durationConstant(id, value) {\n return value = +value, function() {\n set(this, id).duration = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? durationFunction\n : durationConstant)(id, value))\n : get(this.node(), id).duration;\n}\n","import {get, set} from \"./schedule.js\";\n\nfunction easeConstant(id, value) {\n if (typeof value !== \"function\") throw new Error;\n return function() {\n set(this, id).ease = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each(easeConstant(id, value))\n : get(this.node(), id).ease;\n}\n","import {set} from \"./schedule.js\";\n\nfunction easeVarying(id, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (typeof v !== \"function\") throw new Error;\n set(this, id).ease = v;\n };\n}\n\nexport default function(value) {\n if (typeof value !== \"function\") throw new Error;\n return this.each(easeVarying(this._id, value));\n}\n","import {matcher} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Transition(subgroups, this._parents, this._name, this._id);\n}\n","import {Transition} from \"./index.js\";\n\nexport default function(transition) {\n if (transition._id !== this._id) throw new Error;\n\n for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Transition(merges, this._parents, this._name, this._id);\n}\n","import {get, set, init} from \"./schedule.js\";\n\nfunction start(name) {\n return (name + \"\").trim().split(/^|\\s+/).every(function(t) {\n var i = t.indexOf(\".\");\n if (i >= 0) t = t.slice(0, i);\n return !t || t === \"start\";\n });\n}\n\nfunction onFunction(id, name, listener) {\n var on0, on1, sit = start(name) ? init : set;\n return function() {\n var schedule = sit(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, listener) {\n var id = this._id;\n\n return arguments.length < 2\n ? get(this.node(), id).on.on(name)\n : this.each(onFunction(id, name, listener));\n}\n","function removeFunction(id) {\n return function() {\n var parent = this.parentNode;\n for (var i in this.__transition) if (+i !== id) return;\n if (parent) parent.removeChild(this);\n };\n}\n\nexport default function() {\n return this.on(\"end.remove\", removeFunction(this._id));\n}\n","import {selector} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n schedule(subgroup[i], name, id, i, subgroup, get(node, id));\n }\n }\n }\n\n return new Transition(subgroups, this._parents, name, id);\n}\n","import {selectorAll} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {\n if (child = children[k]) {\n schedule(child, name, id, k, children, inherit);\n }\n }\n subgroups.push(children);\n parents.push(node);\n }\n }\n }\n\n return new Transition(subgroups, parents, name, id);\n}\n","import {selection} from \"d3-selection\";\n\nvar Selection = selection.prototype.constructor;\n\nexport default function() {\n return new Selection(this._groups, this._parents);\n}\n","import {interpolateTransformCss as interpolateTransform} from \"d3-interpolate\";\nimport {style} from \"d3-selection\";\nimport {set} from \"./schedule.js\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction styleNull(name, interpolate) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n string1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, string10 = string1);\n };\n}\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = style(this, name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction styleFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n value1 = value(this),\n string1 = value1 + \"\";\n if (value1 == null) string1 = value1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction styleMaybeRemove(id, name) {\n var on0, on1, listener0, key = \"style.\" + name, event = \"end.\" + key, remove;\n return function() {\n var schedule = set(this, id),\n on = schedule.on,\n listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, value, priority) {\n var i = (name += \"\") === \"transform\" ? interpolateTransform : interpolate;\n return value == null ? this\n .styleTween(name, styleNull(name, i))\n .on(\"end.style.\" + name, styleRemove(name))\n : typeof value === \"function\" ? this\n .styleTween(name, styleFunction(name, i, tweenValue(this, \"style.\" + name, value)))\n .each(styleMaybeRemove(this._id, name))\n : this\n .styleTween(name, styleConstant(name, i, value), priority)\n .on(\"end.style.\" + name, null);\n}\n","function styleInterpolate(name, i, priority) {\n return function(t) {\n this.style.setProperty(name, i.call(this, t), priority);\n };\n}\n\nfunction styleTween(name, value, priority) {\n var t, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);\n return t;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value, priority) {\n var key = \"style.\" + (name += \"\");\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, styleTween(name, value, priority == null ? \"\" : priority));\n}\n","import {tweenValue} from \"./tween.js\";\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var value1 = value(this);\n this.textContent = value1 == null ? \"\" : value1;\n };\n}\n\nexport default function(value) {\n return this.tween(\"text\", typeof value === \"function\"\n ? textFunction(tweenValue(this, \"text\", value))\n : textConstant(value == null ? \"\" : value + \"\"));\n}\n","function textInterpolate(i) {\n return function(t) {\n this.textContent = i.call(this, t);\n };\n}\n\nfunction textTween(value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && textInterpolate(i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(value) {\n var key = \"text\";\n if (arguments.length < 1) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, textTween(value));\n}\n","import {Transition, newId} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function() {\n var name = this._name,\n id0 = this._id,\n id1 = newId();\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n var inherit = get(node, id0);\n schedule(node, name, id1, i, group, {\n time: inherit.time + inherit.delay + inherit.duration,\n delay: 0,\n duration: inherit.duration,\n ease: inherit.ease\n });\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id1);\n}\n","import {set} from \"./schedule.js\";\n\nexport default function() {\n var on0, on1, that = this, id = that._id, size = that.size();\n return new Promise(function(resolve, reject) {\n var cancel = {value: reject},\n end = {value: function() { if (--size === 0) resolve(); }};\n\n that.each(function() {\n var schedule = set(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0) {\n on1 = (on0 = on).copy();\n on1._.cancel.push(cancel);\n on1._.interrupt.push(cancel);\n on1._.end.push(end);\n }\n\n schedule.on = on1;\n });\n\n // The selection was empty, resolve end immediately\n if (size === 0) resolve();\n });\n}\n","import {selection} from \"d3-selection\";\nimport transition_attr from \"./attr.js\";\nimport transition_attrTween from \"./attrTween.js\";\nimport transition_delay from \"./delay.js\";\nimport transition_duration from \"./duration.js\";\nimport transition_ease from \"./ease.js\";\nimport transition_easeVarying from \"./easeVarying.js\";\nimport transition_filter from \"./filter.js\";\nimport transition_merge from \"./merge.js\";\nimport transition_on from \"./on.js\";\nimport transition_remove from \"./remove.js\";\nimport transition_select from \"./select.js\";\nimport transition_selectAll from \"./selectAll.js\";\nimport transition_selection from \"./selection.js\";\nimport transition_style from \"./style.js\";\nimport transition_styleTween from \"./styleTween.js\";\nimport transition_text from \"./text.js\";\nimport transition_textTween from \"./textTween.js\";\nimport transition_transition from \"./transition.js\";\nimport transition_tween from \"./tween.js\";\nimport transition_end from \"./end.js\";\n\nvar id = 0;\n\nexport function Transition(groups, parents, name, id) {\n this._groups = groups;\n this._parents = parents;\n this._name = name;\n this._id = id;\n}\n\nexport default function transition(name) {\n return selection().transition(name);\n}\n\nexport function newId() {\n return ++id;\n}\n\nvar selection_prototype = selection.prototype;\n\nTransition.prototype = transition.prototype = {\n constructor: Transition,\n select: transition_select,\n selectAll: transition_selectAll,\n selectChild: selection_prototype.selectChild,\n selectChildren: selection_prototype.selectChildren,\n filter: transition_filter,\n merge: transition_merge,\n selection: transition_selection,\n transition: transition_transition,\n call: selection_prototype.call,\n nodes: selection_prototype.nodes,\n node: selection_prototype.node,\n size: selection_prototype.size,\n empty: selection_prototype.empty,\n each: selection_prototype.each,\n on: transition_on,\n attr: transition_attr,\n attrTween: transition_attrTween,\n style: transition_style,\n styleTween: transition_styleTween,\n text: transition_text,\n textTween: transition_textTween,\n remove: transition_remove,\n tween: transition_tween,\n delay: transition_delay,\n duration: transition_duration,\n ease: transition_ease,\n easeVarying: transition_easeVarying,\n end: transition_end,\n [Symbol.iterator]: selection_prototype[Symbol.iterator]\n};\n","export const linear = t => +t;\n","export function cubicIn(t) {\n return t * t * t;\n}\n\nexport function cubicOut(t) {\n return --t * t * t + 1;\n}\n\nexport function cubicInOut(t) {\n return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\n}\n","import {Transition, newId} from \"../transition/index.js\";\nimport schedule from \"../transition/schedule.js\";\nimport {easeCubicInOut} from \"d3-ease\";\nimport {now} from \"d3-timer\";\n\nvar defaultTiming = {\n time: null, // Set on use.\n delay: 0,\n duration: 250,\n ease: easeCubicInOut\n};\n\nfunction inherit(node, id) {\n var timing;\n while (!(timing = node.__transition) || !(timing = timing[id])) {\n if (!(node = node.parentNode)) {\n throw new Error(`transition ${id} not found`);\n }\n }\n return timing;\n}\n\nexport default function(name) {\n var id,\n timing;\n\n if (name instanceof Transition) {\n id = name._id, name = name._name;\n } else {\n id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + \"\";\n }\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n schedule(node, name, id, i, group, timing || inherit(node, id));\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id);\n}\n","import {selection} from \"d3-selection\";\nimport selection_interrupt from \"./interrupt.js\";\nimport selection_transition from \"./transition.js\";\n\nselection.prototype.interrupt = selection_interrupt;\nselection.prototype.transition = selection_transition;\n","export default x => () => x;\n","export default function BrushEvent(type, {\n sourceEvent,\n target,\n selection,\n mode,\n dispatch\n}) {\n Object.defineProperties(this, {\n type: {value: type, enumerable: true, configurable: true},\n sourceEvent: {value: sourceEvent, enumerable: true, configurable: true},\n target: {value: target, enumerable: true, configurable: true},\n selection: {value: selection, enumerable: true, configurable: true},\n mode: {value: mode, enumerable: true, configurable: true},\n _: {value: dispatch}\n });\n}\n","export function nopropagation(event) {\n event.stopImmediatePropagation();\n}\n\nexport default function(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {dragDisable, dragEnable} from \"d3-drag\";\nimport {interpolate} from \"d3-interpolate\";\nimport {pointer, select} from \"d3-selection\";\nimport {interrupt} from \"d3-transition\";\nimport constant from \"./constant.js\";\nimport BrushEvent from \"./event.js\";\nimport noevent, {nopropagation} from \"./noevent.js\";\n\nvar MODE_DRAG = {name: \"drag\"},\n MODE_SPACE = {name: \"space\"},\n MODE_HANDLE = {name: \"handle\"},\n MODE_CENTER = {name: \"center\"};\n\nconst {abs, max, min} = Math;\n\nfunction number1(e) {\n return [+e[0], +e[1]];\n}\n\nfunction number2(e) {\n return [number1(e[0]), number1(e[1])];\n}\n\nvar X = {\n name: \"x\",\n handles: [\"w\", \"e\"].map(type),\n input: function(x, e) { return x == null ? null : [[+x[0], e[0][1]], [+x[1], e[1][1]]]; },\n output: function(xy) { return xy && [xy[0][0], xy[1][0]]; }\n};\n\nvar Y = {\n name: \"y\",\n handles: [\"n\", \"s\"].map(type),\n input: function(y, e) { return y == null ? null : [[e[0][0], +y[0]], [e[1][0], +y[1]]]; },\n output: function(xy) { return xy && [xy[0][1], xy[1][1]]; }\n};\n\nvar XY = {\n name: \"xy\",\n handles: [\"n\", \"w\", \"e\", \"s\", \"nw\", \"ne\", \"sw\", \"se\"].map(type),\n input: function(xy) { return xy == null ? null : number2(xy); },\n output: function(xy) { return xy; }\n};\n\nvar cursors = {\n overlay: \"crosshair\",\n selection: \"move\",\n n: \"ns-resize\",\n e: \"ew-resize\",\n s: \"ns-resize\",\n w: \"ew-resize\",\n nw: \"nwse-resize\",\n ne: \"nesw-resize\",\n se: \"nwse-resize\",\n sw: \"nesw-resize\"\n};\n\nvar flipX = {\n e: \"w\",\n w: \"e\",\n nw: \"ne\",\n ne: \"nw\",\n se: \"sw\",\n sw: \"se\"\n};\n\nvar flipY = {\n n: \"s\",\n s: \"n\",\n nw: \"sw\",\n ne: \"se\",\n se: \"ne\",\n sw: \"nw\"\n};\n\nvar signsX = {\n overlay: +1,\n selection: +1,\n n: null,\n e: +1,\n s: null,\n w: -1,\n nw: -1,\n ne: +1,\n se: +1,\n sw: -1\n};\n\nvar signsY = {\n overlay: +1,\n selection: +1,\n n: -1,\n e: null,\n s: +1,\n w: null,\n nw: -1,\n ne: -1,\n se: +1,\n sw: +1\n};\n\nfunction type(t) {\n return {type: t};\n}\n\n// Ignore right-click, since that should open the context menu.\nfunction defaultFilter(event) {\n return !event.ctrlKey && !event.button;\n}\n\nfunction defaultExtent() {\n var svg = this.ownerSVGElement || this;\n if (svg.hasAttribute(\"viewBox\")) {\n svg = svg.viewBox.baseVal;\n return [[svg.x, svg.y], [svg.x + svg.width, svg.y + svg.height]];\n }\n return [[0, 0], [svg.width.baseVal.value, svg.height.baseVal.value]];\n}\n\nfunction defaultTouchable() {\n return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\n// Like d3.local, but with the name “__brush” rather than auto-generated.\nfunction local(node) {\n while (!node.__brush) if (!(node = node.parentNode)) return;\n return node.__brush;\n}\n\nfunction empty(extent) {\n return extent[0][0] === extent[1][0]\n || extent[0][1] === extent[1][1];\n}\n\nexport function brushSelection(node) {\n var state = node.__brush;\n return state ? state.dim.output(state.selection) : null;\n}\n\nexport function brushX() {\n return brush(X);\n}\n\nexport function brushY() {\n return brush(Y);\n}\n\nexport default function() {\n return brush(XY);\n}\n\nfunction brush(dim) {\n var extent = defaultExtent,\n filter = defaultFilter,\n touchable = defaultTouchable,\n keys = true,\n listeners = dispatch(\"start\", \"brush\", \"end\"),\n handleSize = 6,\n touchending;\n\n function brush(group) {\n var overlay = group\n .property(\"__brush\", initialize)\n .selectAll(\".overlay\")\n .data([type(\"overlay\")]);\n\n overlay.enter().append(\"rect\")\n .attr(\"class\", \"overlay\")\n .attr(\"pointer-events\", \"all\")\n .attr(\"cursor\", cursors.overlay)\n .merge(overlay)\n .each(function() {\n var extent = local(this).extent;\n select(this)\n .attr(\"x\", extent[0][0])\n .attr(\"y\", extent[0][1])\n .attr(\"width\", extent[1][0] - extent[0][0])\n .attr(\"height\", extent[1][1] - extent[0][1]);\n });\n\n group.selectAll(\".selection\")\n .data([type(\"selection\")])\n .enter().append(\"rect\")\n .attr(\"class\", \"selection\")\n .attr(\"cursor\", cursors.selection)\n .attr(\"fill\", \"#777\")\n .attr(\"fill-opacity\", 0.3)\n .attr(\"stroke\", \"#fff\")\n .attr(\"shape-rendering\", \"crispEdges\");\n\n var handle = group.selectAll(\".handle\")\n .data(dim.handles, function(d) { return d.type; });\n\n handle.exit().remove();\n\n handle.enter().append(\"rect\")\n .attr(\"class\", function(d) { return \"handle handle--\" + d.type; })\n .attr(\"cursor\", function(d) { return cursors[d.type]; });\n\n group\n .each(redraw)\n .attr(\"fill\", \"none\")\n .attr(\"pointer-events\", \"all\")\n .on(\"mousedown.brush\", started)\n .filter(touchable)\n .on(\"touchstart.brush\", started)\n .on(\"touchmove.brush\", touchmoved)\n .on(\"touchend.brush touchcancel.brush\", touchended)\n .style(\"touch-action\", \"none\")\n .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n }\n\n brush.move = function(group, selection, event) {\n if (group.tween) {\n group\n .on(\"start.brush\", function(event) { emitter(this, arguments).beforestart().start(event); })\n .on(\"interrupt.brush end.brush\", function(event) { emitter(this, arguments).end(event); })\n .tween(\"brush\", function() {\n var that = this,\n state = that.__brush,\n emit = emitter(that, arguments),\n selection0 = state.selection,\n selection1 = dim.input(typeof selection === \"function\" ? selection.apply(this, arguments) : selection, state.extent),\n i = interpolate(selection0, selection1);\n\n function tween(t) {\n state.selection = t === 1 && selection1 === null ? null : i(t);\n redraw.call(that);\n emit.brush();\n }\n\n return selection0 !== null && selection1 !== null ? tween : tween(1);\n });\n } else {\n group\n .each(function() {\n var that = this,\n args = arguments,\n state = that.__brush,\n selection1 = dim.input(typeof selection === \"function\" ? selection.apply(that, args) : selection, state.extent),\n emit = emitter(that, args).beforestart();\n\n interrupt(that);\n state.selection = selection1 === null ? null : selection1;\n redraw.call(that);\n emit.start(event).brush(event).end(event);\n });\n }\n };\n\n brush.clear = function(group, event) {\n brush.move(group, null, event);\n };\n\n function redraw() {\n var group = select(this),\n selection = local(this).selection;\n\n if (selection) {\n group.selectAll(\".selection\")\n .style(\"display\", null)\n .attr(\"x\", selection[0][0])\n .attr(\"y\", selection[0][1])\n .attr(\"width\", selection[1][0] - selection[0][0])\n .attr(\"height\", selection[1][1] - selection[0][1]);\n\n group.selectAll(\".handle\")\n .style(\"display\", null)\n .attr(\"x\", function(d) { return d.type[d.type.length - 1] === \"e\" ? selection[1][0] - handleSize / 2 : selection[0][0] - handleSize / 2; })\n .attr(\"y\", function(d) { return d.type[0] === \"s\" ? selection[1][1] - handleSize / 2 : selection[0][1] - handleSize / 2; })\n .attr(\"width\", function(d) { return d.type === \"n\" || d.type === \"s\" ? selection[1][0] - selection[0][0] + handleSize : handleSize; })\n .attr(\"height\", function(d) { return d.type === \"e\" || d.type === \"w\" ? selection[1][1] - selection[0][1] + handleSize : handleSize; });\n }\n\n else {\n group.selectAll(\".selection,.handle\")\n .style(\"display\", \"none\")\n .attr(\"x\", null)\n .attr(\"y\", null)\n .attr(\"width\", null)\n .attr(\"height\", null);\n }\n }\n\n function emitter(that, args, clean) {\n var emit = that.__brush.emitter;\n return emit && (!clean || !emit.clean) ? emit : new Emitter(that, args, clean);\n }\n\n function Emitter(that, args, clean) {\n this.that = that;\n this.args = args;\n this.state = that.__brush;\n this.active = 0;\n this.clean = clean;\n }\n\n Emitter.prototype = {\n beforestart: function() {\n if (++this.active === 1) this.state.emitter = this, this.starting = true;\n return this;\n },\n start: function(event, mode) {\n if (this.starting) this.starting = false, this.emit(\"start\", event, mode);\n else this.emit(\"brush\", event);\n return this;\n },\n brush: function(event, mode) {\n this.emit(\"brush\", event, mode);\n return this;\n },\n end: function(event, mode) {\n if (--this.active === 0) delete this.state.emitter, this.emit(\"end\", event, mode);\n return this;\n },\n emit: function(type, event, mode) {\n var d = select(this.that).datum();\n listeners.call(\n type,\n this.that,\n new BrushEvent(type, {\n sourceEvent: event,\n target: brush,\n selection: dim.output(this.state.selection),\n mode,\n dispatch: listeners\n }),\n d\n );\n }\n };\n\n function started(event) {\n if (touchending && !event.touches) return;\n if (!filter.apply(this, arguments)) return;\n\n var that = this,\n type = event.target.__data__.type,\n mode = (keys && event.metaKey ? type = \"overlay\" : type) === \"selection\" ? MODE_DRAG : (keys && event.altKey ? MODE_CENTER : MODE_HANDLE),\n signX = dim === Y ? null : signsX[type],\n signY = dim === X ? null : signsY[type],\n state = local(that),\n extent = state.extent,\n selection = state.selection,\n W = extent[0][0], w0, w1,\n N = extent[0][1], n0, n1,\n E = extent[1][0], e0, e1,\n S = extent[1][1], s0, s1,\n dx = 0,\n dy = 0,\n moving,\n shifting = signX && signY && keys && event.shiftKey,\n lockX,\n lockY,\n points = Array.from(event.touches || [event], t => {\n const i = t.identifier;\n t = pointer(t, that);\n t.point0 = t.slice();\n t.identifier = i;\n return t;\n });\n\n interrupt(that);\n var emit = emitter(that, arguments, true).beforestart();\n\n if (type === \"overlay\") {\n if (selection) moving = true;\n const pts = [points[0], points[1] || points[0]];\n state.selection = selection = [[\n w0 = dim === Y ? W : min(pts[0][0], pts[1][0]),\n n0 = dim === X ? N : min(pts[0][1], pts[1][1])\n ], [\n e0 = dim === Y ? E : max(pts[0][0], pts[1][0]),\n s0 = dim === X ? S : max(pts[0][1], pts[1][1])\n ]];\n if (points.length > 1) move(event);\n } else {\n w0 = selection[0][0];\n n0 = selection[0][1];\n e0 = selection[1][0];\n s0 = selection[1][1];\n }\n\n w1 = w0;\n n1 = n0;\n e1 = e0;\n s1 = s0;\n\n var group = select(that)\n .attr(\"pointer-events\", \"none\");\n\n var overlay = group.selectAll(\".overlay\")\n .attr(\"cursor\", cursors[type]);\n\n if (event.touches) {\n emit.moved = moved;\n emit.ended = ended;\n } else {\n var view = select(event.view)\n .on(\"mousemove.brush\", moved, true)\n .on(\"mouseup.brush\", ended, true);\n if (keys) view\n .on(\"keydown.brush\", keydowned, true)\n .on(\"keyup.brush\", keyupped, true)\n\n dragDisable(event.view);\n }\n\n redraw.call(that);\n emit.start(event, mode.name);\n\n function moved(event) {\n for (const p of event.changedTouches || [event]) {\n for (const d of points)\n if (d.identifier === p.identifier) d.cur = pointer(p, that);\n }\n if (shifting && !lockX && !lockY && points.length === 1) {\n const point = points[0];\n if (abs(point.cur[0] - point[0]) > abs(point.cur[1] - point[1]))\n lockY = true;\n else\n lockX = true;\n }\n for (const point of points)\n if (point.cur) point[0] = point.cur[0], point[1] = point.cur[1];\n moving = true;\n noevent(event);\n move(event);\n }\n\n function move(event) {\n const point = points[0], point0 = point.point0;\n var t;\n\n dx = point[0] - point0[0];\n dy = point[1] - point0[1];\n\n switch (mode) {\n case MODE_SPACE:\n case MODE_DRAG: {\n if (signX) dx = max(W - w0, min(E - e0, dx)), w1 = w0 + dx, e1 = e0 + dx;\n if (signY) dy = max(N - n0, min(S - s0, dy)), n1 = n0 + dy, s1 = s0 + dy;\n break;\n }\n case MODE_HANDLE: {\n if (points[1]) {\n if (signX) w1 = max(W, min(E, points[0][0])), e1 = max(W, min(E, points[1][0])), signX = 1;\n if (signY) n1 = max(N, min(S, points[0][1])), s1 = max(N, min(S, points[1][1])), signY = 1;\n } else {\n if (signX < 0) dx = max(W - w0, min(E - w0, dx)), w1 = w0 + dx, e1 = e0;\n else if (signX > 0) dx = max(W - e0, min(E - e0, dx)), w1 = w0, e1 = e0 + dx;\n if (signY < 0) dy = max(N - n0, min(S - n0, dy)), n1 = n0 + dy, s1 = s0;\n else if (signY > 0) dy = max(N - s0, min(S - s0, dy)), n1 = n0, s1 = s0 + dy;\n }\n break;\n }\n case MODE_CENTER: {\n if (signX) w1 = max(W, min(E, w0 - dx * signX)), e1 = max(W, min(E, e0 + dx * signX));\n if (signY) n1 = max(N, min(S, n0 - dy * signY)), s1 = max(N, min(S, s0 + dy * signY));\n break;\n }\n }\n\n if (e1 < w1) {\n signX *= -1;\n t = w0, w0 = e0, e0 = t;\n t = w1, w1 = e1, e1 = t;\n if (type in flipX) overlay.attr(\"cursor\", cursors[type = flipX[type]]);\n }\n\n if (s1 < n1) {\n signY *= -1;\n t = n0, n0 = s0, s0 = t;\n t = n1, n1 = s1, s1 = t;\n if (type in flipY) overlay.attr(\"cursor\", cursors[type = flipY[type]]);\n }\n\n if (state.selection) selection = state.selection; // May be set by brush.move!\n if (lockX) w1 = selection[0][0], e1 = selection[1][0];\n if (lockY) n1 = selection[0][1], s1 = selection[1][1];\n\n if (selection[0][0] !== w1\n || selection[0][1] !== n1\n || selection[1][0] !== e1\n || selection[1][1] !== s1) {\n state.selection = [[w1, n1], [e1, s1]];\n redraw.call(that);\n emit.brush(event, mode.name);\n }\n }\n\n function ended(event) {\n nopropagation(event);\n if (event.touches) {\n if (event.touches.length) return;\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!\n } else {\n dragEnable(event.view, moving);\n view.on(\"keydown.brush keyup.brush mousemove.brush mouseup.brush\", null);\n }\n group.attr(\"pointer-events\", \"all\");\n overlay.attr(\"cursor\", cursors.overlay);\n if (state.selection) selection = state.selection; // May be set by brush.move (on start)!\n if (empty(selection)) state.selection = null, redraw.call(that);\n emit.end(event, mode.name);\n }\n\n function keydowned(event) {\n switch (event.keyCode) {\n case 16: { // SHIFT\n shifting = signX && signY;\n break;\n }\n case 18: { // ALT\n if (mode === MODE_HANDLE) {\n if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX;\n if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY;\n mode = MODE_CENTER;\n move(event);\n }\n break;\n }\n case 32: { // SPACE; takes priority over ALT\n if (mode === MODE_HANDLE || mode === MODE_CENTER) {\n if (signX < 0) e0 = e1 - dx; else if (signX > 0) w0 = w1 - dx;\n if (signY < 0) s0 = s1 - dy; else if (signY > 0) n0 = n1 - dy;\n mode = MODE_SPACE;\n overlay.attr(\"cursor\", cursors.selection);\n move(event);\n }\n break;\n }\n default: return;\n }\n noevent(event);\n }\n\n function keyupped(event) {\n switch (event.keyCode) {\n case 16: { // SHIFT\n if (shifting) {\n lockX = lockY = shifting = false;\n move(event);\n }\n break;\n }\n case 18: { // ALT\n if (mode === MODE_CENTER) {\n if (signX < 0) e0 = e1; else if (signX > 0) w0 = w1;\n if (signY < 0) s0 = s1; else if (signY > 0) n0 = n1;\n mode = MODE_HANDLE;\n move(event);\n }\n break;\n }\n case 32: { // SPACE\n if (mode === MODE_SPACE) {\n if (event.altKey) {\n if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX;\n if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY;\n mode = MODE_CENTER;\n } else {\n if (signX < 0) e0 = e1; else if (signX > 0) w0 = w1;\n if (signY < 0) s0 = s1; else if (signY > 0) n0 = n1;\n mode = MODE_HANDLE;\n }\n overlay.attr(\"cursor\", cursors[type]);\n move(event);\n }\n break;\n }\n default: return;\n }\n noevent(event);\n }\n }\n\n function touchmoved(event) {\n emitter(this, arguments).moved(event);\n }\n\n function touchended(event) {\n emitter(this, arguments).ended(event);\n }\n\n function initialize() {\n var state = this.__brush || {selection: null};\n state.extent = number2(extent.apply(this, arguments));\n state.dim = dim;\n return state;\n }\n\n brush.extent = function(_) {\n return arguments.length ? (extent = typeof _ === \"function\" ? _ : constant(number2(_)), brush) : extent;\n };\n\n brush.filter = function(_) {\n return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), brush) : filter;\n };\n\n brush.touchable = function(_) {\n return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), brush) : touchable;\n };\n\n brush.handleSize = function(_) {\n return arguments.length ? (handleSize = +_, brush) : handleSize;\n };\n\n brush.keyModifiers = function(_) {\n return arguments.length ? (keys = !!_, brush) : keys;\n };\n\n brush.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? brush : value;\n };\n\n return brush;\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","export default function(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n}\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns [\"123\", 0].\nexport function formatDecimalParts(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x) {\n return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;\n}\n","export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n","export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n","// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n","// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n","import formatDecimal from \"./formatDecimal.js\";\nimport formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n \"%\": (x, p) => (x * 100).toFixed(p),\n \"b\": (x) => Math.round(x).toString(2),\n \"c\": (x) => x + \"\",\n \"d\": formatDecimal,\n \"e\": (x, p) => x.toExponential(p),\n \"f\": (x, p) => x.toFixed(p),\n \"g\": (x, p) => x.toPrecision(p),\n \"o\": (x) => Math.round(x).toString(8),\n \"p\": (x, p) => formatRounded(x * 100, p),\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": (x) => Math.round(x).toString(16).toUpperCase(),\n \"x\": (x) => Math.round(x).toString(16)\n};\n","export default function(x) {\n return x;\n}\n","import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"−\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n var valueNegative = value < 0 || 1 / value < 0;\n\n // Perform the initial formatting.\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n if (valueNegative && +value === 0 && sign !== \"+\") valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer “value” part that can be\n // grouped, and fractional or exponential “suffix” part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n","export var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var quarterPi = pi / 4;\nexport var tau = pi * 2;\n\nexport var degrees = 180 / pi;\nexport var radians = pi / 180;\n\nexport var abs = Math.abs;\nexport var atan = Math.atan;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var ceil = Math.ceil;\nexport var exp = Math.exp;\nexport var floor = Math.floor;\nexport var hypot = Math.hypot;\nexport var log = Math.log;\nexport var pow = Math.pow;\nexport var sin = Math.sin;\nexport var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };\nexport var sqrt = Math.sqrt;\nexport var tan = Math.tan;\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\nexport function haversin(x) {\n return (x = sin(x / 2)) * x;\n}\n","export default function noop() {}\n","function streamGeometry(geometry, stream) {\n if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {\n streamGeometryType[geometry.type](geometry, stream);\n }\n}\n\nvar streamObjectType = {\n Feature: function(object, stream) {\n streamGeometry(object.geometry, stream);\n },\n FeatureCollection: function(object, stream) {\n var features = object.features, i = -1, n = features.length;\n while (++i < n) streamGeometry(features[i].geometry, stream);\n }\n};\n\nvar streamGeometryType = {\n Sphere: function(object, stream) {\n stream.sphere();\n },\n Point: function(object, stream) {\n object = object.coordinates;\n stream.point(object[0], object[1], object[2]);\n },\n MultiPoint: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) object = coordinates[i], stream.point(object[0], object[1], object[2]);\n },\n LineString: function(object, stream) {\n streamLine(object.coordinates, stream, 0);\n },\n MultiLineString: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamLine(coordinates[i], stream, 0);\n },\n Polygon: function(object, stream) {\n streamPolygon(object.coordinates, stream);\n },\n MultiPolygon: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamPolygon(coordinates[i], stream);\n },\n GeometryCollection: function(object, stream) {\n var geometries = object.geometries, i = -1, n = geometries.length;\n while (++i < n) streamGeometry(geometries[i], stream);\n }\n};\n\nfunction streamLine(coordinates, stream, closed) {\n var i = -1, n = coordinates.length - closed, coordinate;\n stream.lineStart();\n while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]);\n stream.lineEnd();\n}\n\nfunction streamPolygon(coordinates, stream) {\n var i = -1, n = coordinates.length;\n stream.polygonStart();\n while (++i < n) streamLine(coordinates[i], stream, 1);\n stream.polygonEnd();\n}\n\nexport default function(object, stream) {\n if (object && streamObjectType.hasOwnProperty(object.type)) {\n streamObjectType[object.type](object, stream);\n } else {\n streamGeometry(object, stream);\n }\n}\n","import {asin, atan2, cos, sin, sqrt} from \"./math.js\";\n\nexport function spherical(cartesian) {\n return [atan2(cartesian[1], cartesian[0]), asin(cartesian[2])];\n}\n\nexport function cartesian(spherical) {\n var lambda = spherical[0], phi = spherical[1], cosPhi = cos(phi);\n return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)];\n}\n\nexport function cartesianDot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n\nexport function cartesianCross(a, b) {\n return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];\n}\n\n// TODO return a\nexport function cartesianAddInPlace(a, b) {\n a[0] += b[0], a[1] += b[1], a[2] += b[2];\n}\n\nexport function cartesianScale(vector, k) {\n return [vector[0] * k, vector[1] * k, vector[2] * k];\n}\n\n// TODO return d\nexport function cartesianNormalizeInPlace(d) {\n var l = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);\n d[0] /= l, d[1] /= l, d[2] /= l;\n}\n","export default function(a, b) {\n\n function compose(x, y) {\n return x = a(x, y), b(x[0], x[1]);\n }\n\n if (a.invert && b.invert) compose.invert = function(x, y) {\n return x = b.invert(x, y), x && a.invert(x[0], x[1]);\n };\n\n return compose;\n}\n","import compose from \"./compose.js\";\nimport {abs, asin, atan2, cos, degrees, pi, radians, sin, tau} from \"./math.js\";\n\nfunction rotationIdentity(lambda, phi) {\n if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;\n return [lambda, phi];\n}\n\nrotationIdentity.invert = rotationIdentity;\n\nexport function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {\n return (deltaLambda %= tau) ? (deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma))\n : rotationLambda(deltaLambda))\n : (deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma)\n : rotationIdentity);\n}\n\nfunction forwardRotationLambda(deltaLambda) {\n return function(lambda, phi) {\n lambda += deltaLambda;\n if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;\n return [lambda, phi];\n };\n}\n\nfunction rotationLambda(deltaLambda) {\n var rotation = forwardRotationLambda(deltaLambda);\n rotation.invert = forwardRotationLambda(-deltaLambda);\n return rotation;\n}\n\nfunction rotationPhiGamma(deltaPhi, deltaGamma) {\n var cosDeltaPhi = cos(deltaPhi),\n sinDeltaPhi = sin(deltaPhi),\n cosDeltaGamma = cos(deltaGamma),\n sinDeltaGamma = sin(deltaGamma);\n\n function rotation(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaPhi + x * sinDeltaPhi;\n return [\n atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi),\n asin(k * cosDeltaGamma + y * sinDeltaGamma)\n ];\n }\n\n rotation.invert = function(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaGamma - y * sinDeltaGamma;\n return [\n atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi),\n asin(k * cosDeltaPhi - x * sinDeltaPhi)\n ];\n };\n\n return rotation;\n}\n\nexport default function(rotate) {\n rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);\n\n function forward(coordinates) {\n coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n }\n\n forward.invert = function(coordinates) {\n coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n };\n\n return forward;\n}\n","import {cartesian, cartesianNormalizeInPlace, spherical} from \"./cartesian.js\";\nimport constant from \"./constant.js\";\nimport {acos, cos, degrees, epsilon, radians, sin, tau} from \"./math.js\";\nimport {rotateRadians} from \"./rotation.js\";\n\n// Generates a circle centered at [0°, 0°], with a given radius and precision.\nexport function circleStream(stream, radius, delta, direction, t0, t1) {\n if (!delta) return;\n var cosRadius = cos(radius),\n sinRadius = sin(radius),\n step = direction * delta;\n if (t0 == null) {\n t0 = radius + direction * tau;\n t1 = radius - step / 2;\n } else {\n t0 = circleRadius(cosRadius, t0);\n t1 = circleRadius(cosRadius, t1);\n if (direction > 0 ? t0 < t1 : t0 > t1) t0 += direction * tau;\n }\n for (var point, t = t0; direction > 0 ? t > t1 : t < t1; t -= step) {\n point = spherical([cosRadius, -sinRadius * cos(t), -sinRadius * sin(t)]);\n stream.point(point[0], point[1]);\n }\n}\n\n// Returns the signed angle of a cartesian point relative to [cosRadius, 0, 0].\nfunction circleRadius(cosRadius, point) {\n point = cartesian(point), point[0] -= cosRadius;\n cartesianNormalizeInPlace(point);\n var radius = acos(-point[1]);\n return ((-point[2] < 0 ? -radius : radius) + tau - epsilon) % tau;\n}\n\nexport default function() {\n var center = constant([0, 0]),\n radius = constant(90),\n precision = constant(6),\n ring,\n rotate,\n stream = {point: point};\n\n function point(x, y) {\n ring.push(x = rotate(x, y));\n x[0] *= degrees, x[1] *= degrees;\n }\n\n function circle() {\n var c = center.apply(this, arguments),\n r = radius.apply(this, arguments) * radians,\n p = precision.apply(this, arguments) * radians;\n ring = [];\n rotate = rotateRadians(-c[0] * radians, -c[1] * radians, 0).invert;\n circleStream(stream, r, p, 1);\n c = {type: \"Polygon\", coordinates: [ring]};\n ring = rotate = null;\n return c;\n }\n\n circle.center = function(_) {\n return arguments.length ? (center = typeof _ === \"function\" ? _ : constant([+_[0], +_[1]]), circle) : center;\n };\n\n circle.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : constant(+_), circle) : radius;\n };\n\n circle.precision = function(_) {\n return arguments.length ? (precision = typeof _ === \"function\" ? _ : constant(+_), circle) : precision;\n };\n\n return circle;\n}\n","import noop from \"../noop.js\";\n\nexport default function() {\n var lines = [],\n line;\n return {\n point: function(x, y, m) {\n line.push([x, y, m]);\n },\n lineStart: function() {\n lines.push(line = []);\n },\n lineEnd: noop,\n rejoin: function() {\n if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));\n },\n result: function() {\n var result = lines;\n lines = [];\n line = null;\n return result;\n }\n };\n}\n","import {abs, epsilon} from \"./math.js\";\n\nexport default function(a, b) {\n return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon;\n}\n","import pointEqual from \"../pointEqual.js\";\nimport {epsilon} from \"../math.js\";\n\nfunction Intersection(point, points, other, entry) {\n this.x = point;\n this.z = points;\n this.o = other; // another intersection\n this.e = entry; // is an entry?\n this.v = false; // visited\n this.n = this.p = null; // next & previous\n}\n\n// A generalized polygon clipping algorithm: given a polygon that has been cut\n// into its visible line segments, and rejoins the segments by interpolating\n// along the clip edge.\nexport default function(segments, compareIntersection, startInside, interpolate, stream) {\n var subject = [],\n clip = [],\n i,\n n;\n\n segments.forEach(function(segment) {\n if ((n = segment.length - 1) <= 0) return;\n var n, p0 = segment[0], p1 = segment[n], x;\n\n if (pointEqual(p0, p1)) {\n if (!p0[2] && !p1[2]) {\n stream.lineStart();\n for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]);\n stream.lineEnd();\n return;\n }\n // handle degenerate cases by moving the point\n p1[0] += 2 * epsilon;\n }\n\n subject.push(x = new Intersection(p0, segment, null, true));\n clip.push(x.o = new Intersection(p0, null, x, false));\n subject.push(x = new Intersection(p1, segment, null, false));\n clip.push(x.o = new Intersection(p1, null, x, true));\n });\n\n if (!subject.length) return;\n\n clip.sort(compareIntersection);\n link(subject);\n link(clip);\n\n for (i = 0, n = clip.length; i < n; ++i) {\n clip[i].e = startInside = !startInside;\n }\n\n var start = subject[0],\n points,\n point;\n\n while (1) {\n // Find first unvisited intersection.\n var current = start,\n isSubject = true;\n while (current.v) if ((current = current.n) === start) return;\n points = current.z;\n stream.lineStart();\n do {\n current.v = current.o.v = true;\n if (current.e) {\n if (isSubject) {\n for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.n.x, 1, stream);\n }\n current = current.n;\n } else {\n if (isSubject) {\n points = current.p.z;\n for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.p.x, -1, stream);\n }\n current = current.p;\n }\n current = current.o;\n points = current.z;\n isSubject = !isSubject;\n } while (!current.v);\n stream.lineEnd();\n }\n}\n\nfunction link(array) {\n if (!(n = array.length)) return;\n var n,\n i = 0,\n a = array[0],\n b;\n while (++i < n) {\n a.n = b = array[i];\n b.p = a;\n a = b;\n }\n a.n = b = array[0];\n b.p = a;\n}\n","import {Adder} from \"d3-array\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace} from \"./cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, epsilon2, halfPi, pi, quarterPi, sign, sin, tau} from \"./math.js\";\n\nfunction longitude(point) {\n return abs(point[0]) <= pi ? point[0] : sign(point[0]) * ((abs(point[0]) + pi) % tau - pi);\n}\n\nexport default function(polygon, point) {\n var lambda = longitude(point),\n phi = point[1],\n sinPhi = sin(phi),\n normal = [sin(lambda), -cos(lambda), 0],\n angle = 0,\n winding = 0;\n\n var sum = new Adder();\n\n if (sinPhi === 1) phi = halfPi + epsilon;\n else if (sinPhi === -1) phi = -halfPi - epsilon;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n if (!(m = (ring = polygon[i]).length)) continue;\n var ring,\n m,\n point0 = ring[m - 1],\n lambda0 = longitude(point0),\n phi0 = point0[1] / 2 + quarterPi,\n sinPhi0 = sin(phi0),\n cosPhi0 = cos(phi0);\n\n for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) {\n var point1 = ring[j],\n lambda1 = longitude(point1),\n phi1 = point1[1] / 2 + quarterPi,\n sinPhi1 = sin(phi1),\n cosPhi1 = cos(phi1),\n delta = lambda1 - lambda0,\n sign = delta >= 0 ? 1 : -1,\n absDelta = sign * delta,\n antimeridian = absDelta > pi,\n k = sinPhi0 * sinPhi1;\n\n sum.add(atan2(k * sign * sin(absDelta), cosPhi0 * cosPhi1 + k * cos(absDelta)));\n angle += antimeridian ? delta + sign * tau : delta;\n\n // Are the longitudes either side of the point’s meridian (lambda),\n // and are the latitudes smaller than the parallel (phi)?\n if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) {\n var arc = cartesianCross(cartesian(point0), cartesian(point1));\n cartesianNormalizeInPlace(arc);\n var intersection = cartesianCross(normal, arc);\n cartesianNormalizeInPlace(intersection);\n var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]);\n if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) {\n winding += antimeridian ^ delta >= 0 ? 1 : -1;\n }\n }\n }\n }\n\n // First, determine whether the South pole is inside or outside:\n //\n // It is inside if:\n // * the polygon winds around it in a clockwise direction.\n // * the polygon does not (cumulatively) wind around it, but has a negative\n // (counter-clockwise) area.\n //\n // Second, count the (signed) number of times a segment crosses a lambda\n // from the point to the South pole. If it is zero, then the point is the\n // same side as the South pole.\n\n return (angle < -epsilon || angle < epsilon && sum < -epsilon2) ^ (winding & 1);\n}\n","import clipBuffer from \"./buffer.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {epsilon, halfPi} from \"../math.js\";\nimport polygonContains from \"../polygonContains.js\";\nimport {merge} from \"d3-array\";\n\nexport default function(pointVisible, clipLine, interpolate, start) {\n return function(sink) {\n var line = clipLine(sink),\n ringBuffer = clipBuffer(),\n ringSink = clipLine(ringBuffer),\n polygonStarted = false,\n polygon,\n segments,\n ring;\n\n var clip = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() {\n clip.point = pointRing;\n clip.lineStart = ringStart;\n clip.lineEnd = ringEnd;\n segments = [];\n polygon = [];\n },\n polygonEnd: function() {\n clip.point = point;\n clip.lineStart = lineStart;\n clip.lineEnd = lineEnd;\n segments = merge(segments);\n var startInside = polygonContains(polygon, start);\n if (segments.length) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n clipRejoin(segments, compareIntersection, startInside, interpolate, sink);\n } else if (startInside) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n }\n if (polygonStarted) sink.polygonEnd(), polygonStarted = false;\n segments = polygon = null;\n },\n sphere: function() {\n sink.polygonStart();\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n sink.polygonEnd();\n }\n };\n\n function point(lambda, phi) {\n if (pointVisible(lambda, phi)) sink.point(lambda, phi);\n }\n\n function pointLine(lambda, phi) {\n line.point(lambda, phi);\n }\n\n function lineStart() {\n clip.point = pointLine;\n line.lineStart();\n }\n\n function lineEnd() {\n clip.point = point;\n line.lineEnd();\n }\n\n function pointRing(lambda, phi) {\n ring.push([lambda, phi]);\n ringSink.point(lambda, phi);\n }\n\n function ringStart() {\n ringSink.lineStart();\n ring = [];\n }\n\n function ringEnd() {\n pointRing(ring[0][0], ring[0][1]);\n ringSink.lineEnd();\n\n var clean = ringSink.clean(),\n ringSegments = ringBuffer.result(),\n i, n = ringSegments.length, m,\n segment,\n point;\n\n ring.pop();\n polygon.push(ring);\n ring = null;\n\n if (!n) return;\n\n // No intersections.\n if (clean & 1) {\n segment = ringSegments[0];\n if ((m = segment.length - 1) > 0) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n for (i = 0; i < m; ++i) sink.point((point = segment[i])[0], point[1]);\n sink.lineEnd();\n }\n return;\n }\n\n // Rejoin connected segments.\n // TODO reuse ringBuffer.rejoin()?\n if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));\n\n segments.push(ringSegments.filter(validSegment));\n }\n\n return clip;\n };\n}\n\nfunction validSegment(segment) {\n return segment.length > 1;\n}\n\n// Intersections are sorted along the clip edge. For both antimeridian cutting\n// and circle clipping, the same comparison is used.\nfunction compareIntersection(a, b) {\n return ((a = a.x)[0] < 0 ? a[1] - halfPi - epsilon : halfPi - a[1])\n - ((b = b.x)[0] < 0 ? b[1] - halfPi - epsilon : halfPi - b[1]);\n}\n","import clip from \"./index.js\";\nimport {abs, atan, cos, epsilon, halfPi, pi, sin} from \"../math.js\";\n\nexport default clip(\n function() { return true; },\n clipAntimeridianLine,\n clipAntimeridianInterpolate,\n [-pi, -halfPi]\n);\n\n// Takes a line and cuts into visible segments. Return values: 0 - there were\n// intersections or the line was empty; 1 - no intersections; 2 - there were\n// intersections, and the first and last segments should be rejoined.\nfunction clipAntimeridianLine(stream) {\n var lambda0 = NaN,\n phi0 = NaN,\n sign0 = NaN,\n clean; // no intersections\n\n return {\n lineStart: function() {\n stream.lineStart();\n clean = 1;\n },\n point: function(lambda1, phi1) {\n var sign1 = lambda1 > 0 ? pi : -pi,\n delta = abs(lambda1 - lambda0);\n if (abs(delta - pi) < epsilon) { // line crosses a pole\n stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi : -halfPi);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n stream.point(lambda1, phi0);\n clean = 0;\n } else if (sign0 !== sign1 && delta >= pi) { // line crosses antimeridian\n if (abs(lambda0 - sign0) < epsilon) lambda0 -= sign0 * epsilon; // handle degeneracies\n if (abs(lambda1 - sign1) < epsilon) lambda1 -= sign1 * epsilon;\n phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n clean = 0;\n }\n stream.point(lambda0 = lambda1, phi0 = phi1);\n sign0 = sign1;\n },\n lineEnd: function() {\n stream.lineEnd();\n lambda0 = phi0 = NaN;\n },\n clean: function() {\n return 2 - clean; // if intersections, rejoin first and last segments\n }\n };\n}\n\nfunction clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) {\n var cosPhi0,\n cosPhi1,\n sinLambda0Lambda1 = sin(lambda0 - lambda1);\n return abs(sinLambda0Lambda1) > epsilon\n ? atan((sin(phi0) * (cosPhi1 = cos(phi1)) * sin(lambda1)\n - sin(phi1) * (cosPhi0 = cos(phi0)) * sin(lambda0))\n / (cosPhi0 * cosPhi1 * sinLambda0Lambda1))\n : (phi0 + phi1) / 2;\n}\n\nfunction clipAntimeridianInterpolate(from, to, direction, stream) {\n var phi;\n if (from == null) {\n phi = direction * halfPi;\n stream.point(-pi, phi);\n stream.point(0, phi);\n stream.point(pi, phi);\n stream.point(pi, 0);\n stream.point(pi, -phi);\n stream.point(0, -phi);\n stream.point(-pi, -phi);\n stream.point(-pi, 0);\n stream.point(-pi, phi);\n } else if (abs(from[0] - to[0]) > epsilon) {\n var lambda = from[0] < to[0] ? pi : -pi;\n phi = direction * lambda / 2;\n stream.point(-lambda, phi);\n stream.point(0, phi);\n stream.point(lambda, phi);\n } else {\n stream.point(to[0], to[1]);\n }\n}\n","import {cartesian, cartesianAddInPlace, cartesianCross, cartesianDot, cartesianScale, spherical} from \"../cartesian.js\";\nimport {circleStream} from \"../circle.js\";\nimport {abs, cos, epsilon, pi, radians, sqrt} from \"../math.js\";\nimport pointEqual from \"../pointEqual.js\";\nimport clip from \"./index.js\";\n\nexport default function(radius) {\n var cr = cos(radius),\n delta = 6 * radians,\n smallRadius = cr > 0,\n notHemisphere = abs(cr) > epsilon; // TODO optimise for this common case\n\n function interpolate(from, to, direction, stream) {\n circleStream(stream, radius, delta, direction, from, to);\n }\n\n function visible(lambda, phi) {\n return cos(lambda) * cos(phi) > cr;\n }\n\n // Takes a line and cuts into visible segments. Return values used for polygon\n // clipping: 0 - there were intersections or the line was empty; 1 - no\n // intersections 2 - there were intersections, and the first and last segments\n // should be rejoined.\n function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }\n\n // Intersects the great circle between a and b with the clip circle.\n function intersect(a, b, two) {\n var pa = cartesian(a),\n pb = cartesian(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = cartesianCross(pa, pb),\n n2n2 = cartesianDot(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = cartesianCross(n1, n2),\n A = cartesianScale(n1, c1),\n B = cartesianScale(n2, c2);\n cartesianAddInPlace(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = cartesianDot(A, u),\n uu = cartesianDot(u, u),\n t2 = w * w - uu * (cartesianDot(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = sqrt(t2),\n q = cartesianScale(u, (-w - t) / uu);\n cartesianAddInPlace(q, A);\n q = spherical(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = abs(delta - pi) < epsilon,\n meridian = polar || delta < epsilon;\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (abs(q[0] - lambda0) < epsilon ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = cartesianScale(u, (-w + t) / uu);\n cartesianAddInPlace(q1, A);\n return [q, spherical(q1)];\n }\n }\n\n // Generates a 4-bit vector representing the location of a point relative to\n // the small circle's bounding box.\n function code(lambda, phi) {\n var r = smallRadius ? radius : pi - radius,\n code = 0;\n if (lambda < -r) code |= 1; // left\n else if (lambda > r) code |= 2; // right\n if (phi < -r) code |= 4; // below\n else if (phi > r) code |= 8; // above\n return code;\n }\n\n return clip(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]);\n}\n","export default function(a, b, x0, y0, x1, y1) {\n var ax = a[0],\n ay = a[1],\n bx = b[0],\n by = b[1],\n t0 = 0,\n t1 = 1,\n dx = bx - ax,\n dy = by - ay,\n r;\n\n r = x0 - ax;\n if (!dx && r > 0) return;\n r /= dx;\n if (dx < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dx > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = x1 - ax;\n if (!dx && r < 0) return;\n r /= dx;\n if (dx < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dx > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n r = y0 - ay;\n if (!dy && r > 0) return;\n r /= dy;\n if (dy < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dy > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = y1 - ay;\n if (!dy && r < 0) return;\n r /= dy;\n if (dy < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dy > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n if (t0 > 0) a[0] = ax + t0 * dx, a[1] = ay + t0 * dy;\n if (t1 < 1) b[0] = ax + t1 * dx, b[1] = ay + t1 * dy;\n return true;\n}\n","import {abs, epsilon} from \"../math.js\";\nimport clipBuffer from \"./buffer.js\";\nimport clipLine from \"./line.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {merge} from \"d3-array\";\n\nvar clipMax = 1e9, clipMin = -clipMax;\n\n// TODO Use d3-polygon’s polygonContains here for the ring check?\n// TODO Eliminate duplicate buffering in clipBuffer and polygon.push?\n\nexport default function clipRectangle(x0, y0, x1, y1) {\n\n function visible(x, y) {\n return x0 <= x && x <= x1 && y0 <= y && y <= y1;\n }\n\n function interpolate(from, to, direction, stream) {\n var a = 0, a1 = 0;\n if (from == null\n || (a = corner(from, direction)) !== (a1 = corner(to, direction))\n || comparePoint(from, to) < 0 ^ direction > 0) {\n do stream.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);\n while ((a = (a + direction + 4) % 4) !== a1);\n } else {\n stream.point(to[0], to[1]);\n }\n }\n\n function corner(p, direction) {\n return abs(p[0] - x0) < epsilon ? direction > 0 ? 0 : 3\n : abs(p[0] - x1) < epsilon ? direction > 0 ? 2 : 1\n : abs(p[1] - y0) < epsilon ? direction > 0 ? 1 : 0\n : direction > 0 ? 3 : 2; // abs(p[1] - y1) < epsilon\n }\n\n function compareIntersection(a, b) {\n return comparePoint(a.x, b.x);\n }\n\n function comparePoint(a, b) {\n var ca = corner(a, 1),\n cb = corner(b, 1);\n return ca !== cb ? ca - cb\n : ca === 0 ? b[1] - a[1]\n : ca === 1 ? a[0] - b[0]\n : ca === 2 ? a[1] - b[1]\n : b[0] - a[0];\n }\n\n return function(stream) {\n var activeStream = stream,\n bufferStream = clipBuffer(),\n segments,\n polygon,\n ring,\n x__, y__, v__, // first point\n x_, y_, v_, // previous point\n first,\n clean;\n\n var clipStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: polygonStart,\n polygonEnd: polygonEnd\n };\n\n function point(x, y) {\n if (visible(x, y)) activeStream.point(x, y);\n }\n\n function polygonInside() {\n var winding = 0;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n for (var ring = polygon[i], j = 1, m = ring.length, point = ring[0], a0, a1, b0 = point[0], b1 = point[1]; j < m; ++j) {\n a0 = b0, a1 = b1, point = ring[j], b0 = point[0], b1 = point[1];\n if (a1 <= y1) { if (b1 > y1 && (b0 - a0) * (y1 - a1) > (b1 - a1) * (x0 - a0)) ++winding; }\n else { if (b1 <= y1 && (b0 - a0) * (y1 - a1) < (b1 - a1) * (x0 - a0)) --winding; }\n }\n }\n\n return winding;\n }\n\n // Buffer geometry within a polygon and then clip it en masse.\n function polygonStart() {\n activeStream = bufferStream, segments = [], polygon = [], clean = true;\n }\n\n function polygonEnd() {\n var startInside = polygonInside(),\n cleanInside = clean && startInside,\n visible = (segments = merge(segments)).length;\n if (cleanInside || visible) {\n stream.polygonStart();\n if (cleanInside) {\n stream.lineStart();\n interpolate(null, null, 1, stream);\n stream.lineEnd();\n }\n if (visible) {\n clipRejoin(segments, compareIntersection, startInside, interpolate, stream);\n }\n stream.polygonEnd();\n }\n activeStream = stream, segments = polygon = ring = null;\n }\n\n function lineStart() {\n clipStream.point = linePoint;\n if (polygon) polygon.push(ring = []);\n first = true;\n v_ = false;\n x_ = y_ = NaN;\n }\n\n // TODO rather than special-case polygons, simply handle them separately.\n // Ideally, coincident intersection points should be jittered to avoid\n // clipping issues.\n function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }\n\n function linePoint(x, y) {\n var v = visible(x, y);\n if (polygon) ring.push([x, y]);\n if (first) {\n x__ = x, y__ = y, v__ = v;\n first = false;\n if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n }\n } else {\n if (v && v_) activeStream.point(x, y);\n else {\n var a = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))],\n b = [x = Math.max(clipMin, Math.min(clipMax, x)), y = Math.max(clipMin, Math.min(clipMax, y))];\n if (clipLine(a, b, x0, y0, x1, y1)) {\n if (!v_) {\n activeStream.lineStart();\n activeStream.point(a[0], a[1]);\n }\n activeStream.point(b[0], b[1]);\n if (!v) activeStream.lineEnd();\n clean = false;\n } else if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n clean = false;\n }\n }\n }\n x_ = x, y_ = y, v_ = v;\n }\n\n return clipStream;\n };\n}\n","export default x => x;\n","import {Adder} from \"d3-array\";\nimport {abs} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar areaSum = new Adder(),\n areaRingSum = new Adder(),\n x00,\n y00,\n x0,\n y0;\n\nvar areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n areaStream.lineStart = areaStream.lineEnd = areaStream.point = noop;\n areaSum.add(abs(areaRingSum));\n areaRingSum = new Adder();\n },\n result: function() {\n var area = areaSum / 2;\n areaSum = new Adder();\n return area;\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaPointFirst(x, y) {\n areaStream.point = areaPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction areaPoint(x, y) {\n areaRingSum.add(y0 * x - x0 * y);\n x0 = x, y0 = y;\n}\n\nfunction areaRingEnd() {\n areaPoint(x00, y00);\n}\n\nexport default areaStream;\n","import noop from \"../noop.js\";\n\nvar x0 = Infinity,\n y0 = x0,\n x1 = -x0,\n y1 = x1;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: noop,\n polygonEnd: noop,\n result: function() {\n var bounds = [[x0, y0], [x1, y1]];\n x1 = y1 = -(y0 = x0 = Infinity);\n return bounds;\n }\n};\n\nfunction boundsPoint(x, y) {\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n}\n\nexport default boundsStream;\n","import {sqrt} from \"../math.js\";\n\n// TODO Enforce positive area for exterior, negative area for interior?\n\nvar X0 = 0,\n Y0 = 0,\n Z0 = 0,\n X1 = 0,\n Y1 = 0,\n Z1 = 0,\n X2 = 0,\n Y2 = 0,\n Z2 = 0,\n x00,\n y00,\n x0,\n y0;\n\nvar centroidStream = {\n point: centroidPoint,\n lineStart: centroidLineStart,\n lineEnd: centroidLineEnd,\n polygonStart: function() {\n centroidStream.lineStart = centroidRingStart;\n centroidStream.lineEnd = centroidRingEnd;\n },\n polygonEnd: function() {\n centroidStream.point = centroidPoint;\n centroidStream.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n },\n result: function() {\n var centroid = Z2 ? [X2 / Z2, Y2 / Z2]\n : Z1 ? [X1 / Z1, Y1 / Z1]\n : Z0 ? [X0 / Z0, Y0 / Z0]\n : [NaN, NaN];\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 =\n X2 = Y2 = Z2 = 0;\n return centroid;\n }\n};\n\nfunction centroidPoint(x, y) {\n X0 += x;\n Y0 += y;\n ++Z0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidPointFirstLine;\n}\n\nfunction centroidPointFirstLine(x, y) {\n centroidStream.point = centroidPointLine;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidPointLine(x, y) {\n var dx = x - x0, dy = y - y0, z = sqrt(dx * dx + dy * dy);\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingStart() {\n centroidStream.point = centroidPointFirstRing;\n}\n\nfunction centroidRingEnd() {\n centroidPointRing(x00, y00);\n}\n\nfunction centroidPointFirstRing(x, y) {\n centroidStream.point = centroidPointRing;\n centroidPoint(x00 = x0 = x, y00 = y0 = y);\n}\n\nfunction centroidPointRing(x, y) {\n var dx = x - x0,\n dy = y - y0,\n z = sqrt(dx * dx + dy * dy);\n\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n\n z = y0 * x - x0 * y;\n X2 += z * (x0 + x);\n Y2 += z * (y0 + y);\n Z2 += z * 3;\n centroidPoint(x0 = x, y0 = y);\n}\n\nexport default centroidStream;\n","import {tau} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nexport default function PathContext(context) {\n this._context = context;\n}\n\nPathContext.prototype = {\n _radius: 4.5,\n pointRadius: function(_) {\n return this._radius = _, this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._context.closePath();\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._context.moveTo(x, y);\n this._point = 1;\n break;\n }\n case 1: {\n this._context.lineTo(x, y);\n break;\n }\n default: {\n this._context.moveTo(x + this._radius, y);\n this._context.arc(x, y, this._radius, 0, tau);\n break;\n }\n }\n },\n result: noop\n};\n","import {Adder} from \"d3-array\";\nimport {sqrt} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar lengthSum = new Adder(),\n lengthRing,\n x00,\n y00,\n x0,\n y0;\n\nvar lengthStream = {\n point: noop,\n lineStart: function() {\n lengthStream.point = lengthPointFirst;\n },\n lineEnd: function() {\n if (lengthRing) lengthPoint(x00, y00);\n lengthStream.point = noop;\n },\n polygonStart: function() {\n lengthRing = true;\n },\n polygonEnd: function() {\n lengthRing = null;\n },\n result: function() {\n var length = +lengthSum;\n lengthSum = new Adder();\n return length;\n }\n};\n\nfunction lengthPointFirst(x, y) {\n lengthStream.point = lengthPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction lengthPoint(x, y) {\n x0 -= x, y0 -= y;\n lengthSum.add(sqrt(x0 * x0 + y0 * y0));\n x0 = x, y0 = y;\n}\n\nexport default lengthStream;\n","// Simple caching for constant-radius points.\nlet cacheDigits, cacheAppend, cacheRadius, cacheCircle;\n\nexport default class PathString {\n constructor(digits) {\n this._append = digits == null ? append : appendRound(digits);\n this._radius = 4.5;\n this._ = \"\";\n }\n pointRadius(_) {\n this._radius = +_;\n return this;\n }\n polygonStart() {\n this._line = 0;\n }\n polygonEnd() {\n this._line = NaN;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {\n if (this._line === 0) this._ += \"Z\";\n this._point = NaN;\n }\n point(x, y) {\n switch (this._point) {\n case 0: {\n this._append`M${x},${y}`;\n this._point = 1;\n break;\n }\n case 1: {\n this._append`L${x},${y}`;\n break;\n }\n default: {\n this._append`M${x},${y}`;\n if (this._radius !== cacheRadius || this._append !== cacheAppend) {\n const r = this._radius;\n const s = this._;\n this._ = \"\"; // stash the old string so we can cache the circle path fragment\n this._append`m0,${r}a${r},${r} 0 1,1 0,${-2 * r}a${r},${r} 0 1,1 0,${2 * r}z`;\n cacheRadius = r;\n cacheAppend = this._append;\n cacheCircle = this._;\n this._ = s;\n }\n this._ += cacheCircle;\n break;\n }\n }\n }\n result() {\n const result = this._;\n this._ = \"\";\n return result.length ? result : null;\n }\n}\n\nfunction append(strings) {\n let i = 1;\n this._ += strings[0];\n for (const j = strings.length; i < j; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n const d = Math.floor(digits);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${digits}`);\n if (d > 15) return append;\n if (d !== cacheDigits) {\n const k = 10 ** d;\n cacheDigits = d;\n cacheAppend = function append(strings) {\n let i = 1;\n this._ += strings[0];\n for (const j = strings.length; i < j; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n }\n return cacheAppend;\n}\n","import identity from \"../identity.js\";\nimport stream from \"../stream.js\";\nimport pathArea from \"./area.js\";\nimport pathBounds from \"./bounds.js\";\nimport pathCentroid from \"./centroid.js\";\nimport PathContext from \"./context.js\";\nimport pathMeasure from \"./measure.js\";\nimport PathString from \"./string.js\";\n\nexport default function(projection, context) {\n let digits = 3,\n pointRadius = 4.5,\n projectionStream,\n contextStream;\n\n function path(object) {\n if (object) {\n if (typeof pointRadius === \"function\") contextStream.pointRadius(+pointRadius.apply(this, arguments));\n stream(object, projectionStream(contextStream));\n }\n return contextStream.result();\n }\n\n path.area = function(object) {\n stream(object, projectionStream(pathArea));\n return pathArea.result();\n };\n\n path.measure = function(object) {\n stream(object, projectionStream(pathMeasure));\n return pathMeasure.result();\n };\n\n path.bounds = function(object) {\n stream(object, projectionStream(pathBounds));\n return pathBounds.result();\n };\n\n path.centroid = function(object) {\n stream(object, projectionStream(pathCentroid));\n return pathCentroid.result();\n };\n\n path.projection = function(_) {\n if (!arguments.length) return projection;\n projectionStream = _ == null ? (projection = null, identity) : (projection = _).stream;\n return path;\n };\n\n path.context = function(_) {\n if (!arguments.length) return context;\n contextStream = _ == null ? (context = null, new PathString(digits)) : new PathContext(context = _);\n if (typeof pointRadius !== \"function\") contextStream.pointRadius(pointRadius);\n return path;\n };\n\n path.pointRadius = function(_) {\n if (!arguments.length) return pointRadius;\n pointRadius = typeof _ === \"function\" ? _ : (contextStream.pointRadius(+_), +_);\n return path;\n };\n\n path.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) digits = null;\n else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n if (context === null) contextStream = new PathString(digits);\n return path;\n };\n\n return path.projection(projection).digits(digits).context(context);\n}\n","export default function(methods) {\n return {\n stream: transformer(methods)\n };\n}\n\nexport function transformer(methods) {\n return function(stream) {\n var s = new TransformStream;\n for (var key in methods) s[key] = methods[key];\n s.stream = stream;\n return s;\n };\n}\n\nfunction TransformStream() {}\n\nTransformStream.prototype = {\n constructor: TransformStream,\n point: function(x, y) { this.stream.point(x, y); },\n sphere: function() { this.stream.sphere(); },\n lineStart: function() { this.stream.lineStart(); },\n lineEnd: function() { this.stream.lineEnd(); },\n polygonStart: function() { this.stream.polygonStart(); },\n polygonEnd: function() { this.stream.polygonEnd(); }\n};\n","import {default as geoStream} from \"../stream.js\";\nimport boundsStream from \"../path/bounds.js\";\n\nfunction fit(projection, fitBounds, object) {\n var clip = projection.clipExtent && projection.clipExtent();\n projection.scale(150).translate([0, 0]);\n if (clip != null) projection.clipExtent(null);\n geoStream(object, projection.stream(boundsStream));\n fitBounds(boundsStream.result());\n if (clip != null) projection.clipExtent(clip);\n return projection;\n}\n\nexport function fitExtent(projection, extent, object) {\n return fit(projection, function(b) {\n var w = extent[1][0] - extent[0][0],\n h = extent[1][1] - extent[0][1],\n k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])),\n x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2,\n y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitSize(projection, size, object) {\n return fitExtent(projection, [[0, 0], size], object);\n}\n\nexport function fitWidth(projection, width, object) {\n return fit(projection, function(b) {\n var w = +width,\n k = w / (b[1][0] - b[0][0]),\n x = (w - k * (b[1][0] + b[0][0])) / 2,\n y = -k * b[0][1];\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitHeight(projection, height, object) {\n return fit(projection, function(b) {\n var h = +height,\n k = h / (b[1][1] - b[0][1]),\n x = -k * b[0][0],\n y = (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n","import {cartesian} from \"../cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, radians, sqrt} from \"../math.js\";\nimport {transformer} from \"../transform.js\";\n\nvar maxDepth = 16, // maximum depth of subdivision\n cosMinDistance = cos(30 * radians); // cos(minimum angular distance)\n\nexport default function(project, delta2) {\n return +delta2 ? resample(project, delta2) : resampleNone(project);\n}\n\nfunction resampleNone(project) {\n return transformer({\n point: function(x, y) {\n x = project(x, y);\n this.stream.point(x[0], x[1]);\n }\n });\n}\n\nfunction resample(project, delta2) {\n\n function resampleLineTo(x0, y0, lambda0, a0, b0, c0, x1, y1, lambda1, a1, b1, c1, depth, stream) {\n var dx = x1 - x0,\n dy = y1 - y0,\n d2 = dx * dx + dy * dy;\n if (d2 > 4 * delta2 && depth--) {\n var a = a0 + a1,\n b = b0 + b1,\n c = c0 + c1,\n m = sqrt(a * a + b * b + c * c),\n phi2 = asin(c /= m),\n lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b, a),\n p = project(lambda2, phi2),\n x2 = p[0],\n y2 = p[1],\n dx2 = x2 - x0,\n dy2 = y2 - y0,\n dz = dy * dx2 - dx * dy2;\n if (dz * dz / d2 > delta2 // perpendicular projected distance\n || abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 // midpoint close to an end\n || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { // angular distance\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x2, y2, lambda2, a /= m, b /= m, c, depth, stream);\n stream.point(x2, y2);\n resampleLineTo(x2, y2, lambda2, a, b, c, x1, y1, lambda1, a1, b1, c1, depth, stream);\n }\n }\n }\n return function(stream) {\n var lambda00, x00, y00, a00, b00, c00, // first point\n lambda0, x0, y0, a0, b0, c0; // previous point\n\n var resampleStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() { stream.polygonStart(); resampleStream.lineStart = ringStart; },\n polygonEnd: function() { stream.polygonEnd(); resampleStream.lineStart = lineStart; }\n };\n\n function point(x, y) {\n x = project(x, y);\n stream.point(x[0], x[1]);\n }\n\n function lineStart() {\n x0 = NaN;\n resampleStream.point = linePoint;\n stream.lineStart();\n }\n\n function linePoint(lambda, phi) {\n var c = cartesian([lambda, phi]), p = project(lambda, phi);\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x0 = p[0], y0 = p[1], lambda0 = lambda, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);\n stream.point(x0, y0);\n }\n\n function lineEnd() {\n resampleStream.point = point;\n stream.lineEnd();\n }\n\n function ringStart() {\n lineStart();\n resampleStream.point = ringPoint;\n resampleStream.lineEnd = ringEnd;\n }\n\n function ringPoint(lambda, phi) {\n linePoint(lambda00 = lambda, phi), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;\n resampleStream.point = linePoint;\n }\n\n function ringEnd() {\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x00, y00, lambda00, a00, b00, c00, maxDepth, stream);\n resampleStream.lineEnd = lineEnd;\n lineEnd();\n }\n\n return resampleStream;\n };\n}\n","import clipAntimeridian from \"../clip/antimeridian.js\";\nimport clipCircle from \"../clip/circle.js\";\nimport clipRectangle from \"../clip/rectangle.js\";\nimport compose from \"../compose.js\";\nimport identity from \"../identity.js\";\nimport {cos, degrees, radians, sin, sqrt} from \"../math.js\";\nimport {rotateRadians} from \"../rotation.js\";\nimport {transformer} from \"../transform.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\nimport resample from \"./resample.js\";\n\nvar transformRadians = transformer({\n point: function(x, y) {\n this.stream.point(x * radians, y * radians);\n }\n});\n\nfunction transformRotate(rotate) {\n return transformer({\n point: function(x, y) {\n var r = rotate(x, y);\n return this.stream.point(r[0], r[1]);\n }\n });\n}\n\nfunction scaleTranslate(k, dx, dy, sx, sy) {\n function transform(x, y) {\n x *= sx; y *= sy;\n return [dx + k * x, dy - k * y];\n }\n transform.invert = function(x, y) {\n return [(x - dx) / k * sx, (dy - y) / k * sy];\n };\n return transform;\n}\n\nfunction scaleTranslateRotate(k, dx, dy, sx, sy, alpha) {\n if (!alpha) return scaleTranslate(k, dx, dy, sx, sy);\n var cosAlpha = cos(alpha),\n sinAlpha = sin(alpha),\n a = cosAlpha * k,\n b = sinAlpha * k,\n ai = cosAlpha / k,\n bi = sinAlpha / k,\n ci = (sinAlpha * dy - cosAlpha * dx) / k,\n fi = (sinAlpha * dx + cosAlpha * dy) / k;\n function transform(x, y) {\n x *= sx; y *= sy;\n return [a * x - b * y + dx, dy - b * x - a * y];\n }\n transform.invert = function(x, y) {\n return [sx * (ai * x - bi * y + ci), sy * (fi - bi * x - ai * y)];\n };\n return transform;\n}\n\nexport default function projection(project) {\n return projectionMutator(function() { return project; })();\n}\n\nexport function projectionMutator(projectAt) {\n var project,\n k = 150, // scale\n x = 480, y = 250, // translate\n lambda = 0, phi = 0, // center\n deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, // pre-rotate\n alpha = 0, // post-rotate angle\n sx = 1, // reflectX\n sy = 1, // reflectX\n theta = null, preclip = clipAntimeridian, // pre-clip angle\n x0 = null, y0, x1, y1, postclip = identity, // post-clip extent\n delta2 = 0.5, // precision\n projectResample,\n projectTransform,\n projectRotateTransform,\n cache,\n cacheStream;\n\n function projection(point) {\n return projectRotateTransform(point[0] * radians, point[1] * radians);\n }\n\n function invert(point) {\n point = projectRotateTransform.invert(point[0], point[1]);\n return point && [point[0] * degrees, point[1] * degrees];\n }\n\n projection.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream)))));\n };\n\n projection.preclip = function(_) {\n return arguments.length ? (preclip = _, theta = undefined, reset()) : preclip;\n };\n\n projection.postclip = function(_) {\n return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;\n };\n\n projection.clipAngle = function(_) {\n return arguments.length ? (preclip = +_ ? clipCircle(theta = _ * radians) : (theta = null, clipAntimeridian), reset()) : theta * degrees;\n };\n\n projection.clipExtent = function(_) {\n return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n projection.scale = function(_) {\n return arguments.length ? (k = +_, recenter()) : k;\n };\n\n projection.translate = function(_) {\n return arguments.length ? (x = +_[0], y = +_[1], recenter()) : [x, y];\n };\n\n projection.center = function(_) {\n return arguments.length ? (lambda = _[0] % 360 * radians, phi = _[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees];\n };\n\n projection.rotate = function(_) {\n return arguments.length ? (deltaLambda = _[0] % 360 * radians, deltaPhi = _[1] % 360 * radians, deltaGamma = _.length > 2 ? _[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees, deltaPhi * degrees, deltaGamma * degrees];\n };\n\n projection.angle = function(_) {\n return arguments.length ? (alpha = _ % 360 * radians, recenter()) : alpha * degrees;\n };\n\n projection.reflectX = function(_) {\n return arguments.length ? (sx = _ ? -1 : 1, recenter()) : sx < 0;\n };\n\n projection.reflectY = function(_) {\n return arguments.length ? (sy = _ ? -1 : 1, recenter()) : sy < 0;\n };\n\n projection.precision = function(_) {\n return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt(delta2);\n };\n\n projection.fitExtent = function(extent, object) {\n return fitExtent(projection, extent, object);\n };\n\n projection.fitSize = function(size, object) {\n return fitSize(projection, size, object);\n };\n\n projection.fitWidth = function(width, object) {\n return fitWidth(projection, width, object);\n };\n\n projection.fitHeight = function(height, object) {\n return fitHeight(projection, height, object);\n };\n\n function recenter() {\n var center = scaleTranslateRotate(k, 0, 0, sx, sy, alpha).apply(null, project(lambda, phi)),\n transform = scaleTranslateRotate(k, x - center[0], y - center[1], sx, sy, alpha);\n rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma);\n projectTransform = compose(project, transform);\n projectRotateTransform = compose(rotate, projectTransform);\n projectResample = resample(projectTransform, delta2);\n return reset();\n }\n\n function reset() {\n cache = cacheStream = null;\n return projection;\n }\n\n return function() {\n project = projectAt.apply(this, arguments);\n projection.invert = project.invert && invert;\n return recenter();\n };\n}\n","import {degrees, pi, radians} from \"../math.js\";\nimport {projectionMutator} from \"./index.js\";\n\nexport function conicProjection(projectAt) {\n var phi0 = 0,\n phi1 = pi / 3,\n m = projectionMutator(projectAt),\n p = m(phi0, phi1);\n\n p.parallels = function(_) {\n return arguments.length ? m(phi0 = _[0] * radians, phi1 = _[1] * radians) : [phi0 * degrees, phi1 * degrees];\n };\n\n return p;\n}\n","import {asin, cos, sin} from \"../math.js\";\n\nexport function cylindricalEqualAreaRaw(phi0) {\n var cosPhi0 = cos(phi0);\n\n function forward(lambda, phi) {\n return [lambda * cosPhi0, sin(phi) / cosPhi0];\n }\n\n forward.invert = function(x, y) {\n return [x / cosPhi0, asin(y * cosPhi0)];\n };\n\n return forward;\n}\n","import {abs, asin, atan2, cos, epsilon, pi, sign, sin, sqrt} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {cylindricalEqualAreaRaw} from \"./cylindricalEqualArea.js\";\n\nexport function conicEqualAreaRaw(y0, y1) {\n var sy0 = sin(y0), n = (sy0 + sin(y1)) / 2;\n\n // Are the parallels symmetrical around the Equator?\n if (abs(n) < epsilon) return cylindricalEqualAreaRaw(y0);\n\n var c = 1 + sy0 * (2 * n - sy0), r0 = sqrt(c) / n;\n\n function project(x, y) {\n var r = sqrt(c - 2 * n * sin(y)) / n;\n return [r * sin(x *= n), r0 - r * cos(x)];\n }\n\n project.invert = function(x, y) {\n var r0y = r0 - y,\n l = atan2(x, abs(r0y)) * sign(r0y);\n if (r0y * n < 0)\n l -= pi * sign(x) * sign(r0y);\n return [l / n, asin((c - (x * x + r0y * r0y) * n * n) / (2 * n))];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicEqualAreaRaw)\n .scale(155.424)\n .center([0, 33.6442]);\n}\n","import conicEqualArea from \"./conicEqualArea.js\";\n\nexport default function() {\n return conicEqualArea()\n .parallels([29.5, 45.5])\n .scale(1070)\n .translate([480, 250])\n .rotate([96, 0])\n .center([-0.6, 38.7]);\n}\n","import {atan, exp, halfPi, log, pi, tan, tau} from \"../math.js\";\nimport rotation from \"../rotation.js\";\nimport projection from \"./index.js\";\n\nexport function mercatorRaw(lambda, phi) {\n return [lambda, log(tan((halfPi + phi) / 2))];\n}\n\nmercatorRaw.invert = function(x, y) {\n return [x, 2 * atan(exp(y)) - halfPi];\n};\n\nexport default function() {\n return mercatorProjection(mercatorRaw)\n .scale(961 / tau);\n}\n\nexport function mercatorProjection(project) {\n var m = projection(project),\n center = m.center,\n scale = m.scale,\n translate = m.translate,\n clipExtent = m.clipExtent,\n x0 = null, y0, x1, y1; // clip extent\n\n m.scale = function(_) {\n return arguments.length ? (scale(_), reclip()) : scale();\n };\n\n m.translate = function(_) {\n return arguments.length ? (translate(_), reclip()) : translate();\n };\n\n m.center = function(_) {\n return arguments.length ? (center(_), reclip()) : center();\n };\n\n m.clipExtent = function(_) {\n return arguments.length ? ((_ == null ? x0 = y0 = x1 = y1 = null : (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1])), reclip()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n function reclip() {\n var k = pi * scale(),\n t = m(rotation(m.rotate()).invert([0, 0]));\n return clipExtent(x0 == null\n ? [[t[0] - k, t[1] - k], [t[0] + k, t[1] + k]] : project === mercatorRaw\n ? [[Math.max(t[0] - k, x0), y0], [Math.min(t[0] + k, x1), y1]]\n : [[x0, Math.max(t[1] - k, y0)], [x1, Math.min(t[1] + k, y1)]]);\n }\n\n return reclip();\n}\n","import projection from \"./index.js\";\n\nexport function equirectangularRaw(lambda, phi) {\n return [lambda, phi];\n}\n\nequirectangularRaw.invert = equirectangularRaw;\n\nexport default function() {\n return projection(equirectangularRaw)\n .scale(152.63);\n}\n","import {abs, atan2, cos, epsilon, pi, sign, sin, sqrt} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {equirectangularRaw} from \"./equirectangular.js\";\n\nexport function conicEquidistantRaw(y0, y1) {\n var cy0 = cos(y0),\n n = y0 === y1 ? sin(y0) : (cy0 - cos(y1)) / (y1 - y0),\n g = cy0 / n + y0;\n\n if (abs(n) < epsilon) return equirectangularRaw;\n\n function project(x, y) {\n var gy = g - y, nx = n * x;\n return [gy * sin(nx), g - gy * cos(nx)];\n }\n\n project.invert = function(x, y) {\n var gy = g - y,\n l = atan2(x, abs(gy)) * sign(gy);\n if (gy * n < 0)\n l -= pi * sign(x) * sign(gy);\n return [l / n, g - sign(n) * sqrt(x * x + gy * gy)];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicEquidistantRaw)\n .scale(131.154)\n .center([0, 13.9389]);\n}\n","import projection from \"./index.js\";\nimport {abs, asin, cos, epsilon2, sin, sqrt} from \"../math.js\";\n\nvar A1 = 1.340264,\n A2 = -0.081106,\n A3 = 0.000893,\n A4 = 0.003796,\n M = sqrt(3) / 2,\n iterations = 12;\n\nexport function equalEarthRaw(lambda, phi) {\n var l = asin(M * sin(phi)), l2 = l * l, l6 = l2 * l2 * l2;\n return [\n lambda * cos(l) / (M * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2))),\n l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2))\n ];\n}\n\nequalEarthRaw.invert = function(x, y) {\n var l = y, l2 = l * l, l6 = l2 * l2 * l2;\n for (var i = 0, delta, fy, fpy; i < iterations; ++i) {\n fy = l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) - y;\n fpy = A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2);\n l -= delta = fy / fpy, l2 = l * l, l6 = l2 * l2 * l2;\n if (abs(delta) < epsilon2) break;\n }\n return [\n M * x * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2)) / cos(l),\n asin(sin(l) / M)\n ];\n};\n\nexport default function() {\n return projection(equalEarthRaw)\n .scale(177.158);\n}\n","import projection from \"./index.js\";\nimport {abs, epsilon} from \"../math.js\";\n\nexport function naturalEarth1Raw(lambda, phi) {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n return [\n lambda * (0.8707 - 0.131979 * phi2 + phi4 * (-0.013791 + phi4 * (0.003971 * phi2 - 0.001529 * phi4))),\n phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4)))\n ];\n}\n\nnaturalEarth1Raw.invert = function(x, y) {\n var phi = y, i = 25, delta;\n do {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n phi -= delta = (phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4))) - y) /\n (1.007226 + phi2 * (0.015085 * 3 + phi4 * (-0.044475 * 7 + 0.028874 * 9 * phi2 - 0.005916 * 11 * phi4)));\n } while (abs(delta) > epsilon && --i > 0);\n return [\n x / (0.8707 + (phi2 = phi * phi) * (-0.131979 + phi2 * (-0.013791 + phi2 * phi2 * phi2 * (0.003971 - 0.001529 * phi2)))),\n phi\n ];\n};\n\nexport default function() {\n return projection(naturalEarth1Raw)\n .scale(175.295);\n}\n","function defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\nfunction meanX(children) {\n return children.reduce(meanXReduce, 0) / children.length;\n}\n\nfunction meanXReduce(x, c) {\n return x + c.x;\n}\n\nfunction maxY(children) {\n return 1 + children.reduce(maxYReduce, 0);\n}\n\nfunction maxYReduce(y, c) {\n return Math.max(y, c.y);\n}\n\nfunction leafLeft(node) {\n var children;\n while (children = node.children) node = children[0];\n return node;\n}\n\nfunction leafRight(node) {\n var children;\n while (children = node.children) node = children[children.length - 1];\n return node;\n}\n\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = false;\n\n function cluster(root) {\n var previousNode,\n x = 0;\n\n // First walk, computing the initial x & y values.\n root.eachAfter(function(node) {\n var children = node.children;\n if (children) {\n node.x = meanX(children);\n node.y = maxY(children);\n } else {\n node.x = previousNode ? x += separation(node, previousNode) : 0;\n node.y = 0;\n previousNode = node;\n }\n });\n\n var left = leafLeft(root),\n right = leafRight(root),\n x0 = left.x - separation(left, right) / 2,\n x1 = right.x + separation(right, left) / 2;\n\n // Second walk, normalizing x & y to the desired size.\n return root.eachAfter(nodeSize ? function(node) {\n node.x = (node.x - root.x) * dx;\n node.y = (root.y - node.y) * dy;\n } : function(node) {\n node.x = (node.x - x0) / (x1 - x0) * dx;\n node.y = (1 - (root.y ? node.y / root.y : 1)) * dy;\n });\n }\n\n cluster.separation = function(x) {\n return arguments.length ? (separation = x, cluster) : separation;\n };\n\n cluster.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? null : [dx, dy]);\n };\n\n cluster.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? [dx, dy] : null);\n };\n\n return cluster;\n}\n","function count(node) {\n var sum = 0,\n children = node.children,\n i = children && children.length;\n if (!i) sum = 1;\n else while (--i >= 0) sum += children[i].value;\n node.value = sum;\n}\n\nexport default function() {\n return this.eachAfter(count);\n}\n","export default function(callback, that) {\n let index = -1;\n for (const node of this) {\n callback.call(that, node, ++index, this);\n }\n return this;\n}\n","export default function(callback, that) {\n var node = this, nodes = [node], children, i, index = -1;\n while (node = nodes.pop()) {\n callback.call(that, node, ++index, this);\n if (children = node.children) {\n for (i = children.length - 1; i >= 0; --i) {\n nodes.push(children[i]);\n }\n }\n }\n return this;\n}\n","export default function(callback, that) {\n var node = this, nodes = [node], next = [], children, i, n, index = -1;\n while (node = nodes.pop()) {\n next.push(node);\n if (children = node.children) {\n for (i = 0, n = children.length; i < n; ++i) {\n nodes.push(children[i]);\n }\n }\n }\n while (node = next.pop()) {\n callback.call(that, node, ++index, this);\n }\n return this;\n}\n","export default function(callback, that) {\n let index = -1;\n for (const node of this) {\n if (callback.call(that, node, ++index, this)) {\n return node;\n }\n }\n}\n","export default function(value) {\n return this.eachAfter(function(node) {\n var sum = +value(node.data) || 0,\n children = node.children,\n i = children && children.length;\n while (--i >= 0) sum += children[i].value;\n node.value = sum;\n });\n}\n","export default function(compare) {\n return this.eachBefore(function(node) {\n if (node.children) {\n node.children.sort(compare);\n }\n });\n}\n","export default function(end) {\n var start = this,\n ancestor = leastCommonAncestor(start, end),\n nodes = [start];\n while (start !== ancestor) {\n start = start.parent;\n nodes.push(start);\n }\n var k = nodes.length;\n while (end !== ancestor) {\n nodes.splice(k, 0, end);\n end = end.parent;\n }\n return nodes;\n}\n\nfunction leastCommonAncestor(a, b) {\n if (a === b) return a;\n var aNodes = a.ancestors(),\n bNodes = b.ancestors(),\n c = null;\n a = aNodes.pop();\n b = bNodes.pop();\n while (a === b) {\n c = a;\n a = aNodes.pop();\n b = bNodes.pop();\n }\n return c;\n}\n","export default function() {\n var node = this, nodes = [node];\n while (node = node.parent) {\n nodes.push(node);\n }\n return nodes;\n}\n","export default function() {\n return Array.from(this);\n}\n","export default function() {\n var leaves = [];\n this.eachBefore(function(node) {\n if (!node.children) {\n leaves.push(node);\n }\n });\n return leaves;\n}\n","export default function() {\n var root = this, links = [];\n root.each(function(node) {\n if (node !== root) { // Don’t include the root’s parent, if any.\n links.push({source: node.parent, target: node});\n }\n });\n return links;\n}\n","export default function*() {\n var node = this, current, next = [node], children, i, n;\n do {\n current = next.reverse(), next = [];\n while (node = current.pop()) {\n yield node;\n if (children = node.children) {\n for (i = 0, n = children.length; i < n; ++i) {\n next.push(children[i]);\n }\n }\n }\n } while (next.length);\n}\n","import node_count from \"./count.js\";\nimport node_each from \"./each.js\";\nimport node_eachBefore from \"./eachBefore.js\";\nimport node_eachAfter from \"./eachAfter.js\";\nimport node_find from \"./find.js\";\nimport node_sum from \"./sum.js\";\nimport node_sort from \"./sort.js\";\nimport node_path from \"./path.js\";\nimport node_ancestors from \"./ancestors.js\";\nimport node_descendants from \"./descendants.js\";\nimport node_leaves from \"./leaves.js\";\nimport node_links from \"./links.js\";\nimport node_iterator from \"./iterator.js\";\n\nexport default function hierarchy(data, children) {\n if (data instanceof Map) {\n data = [undefined, data];\n if (children === undefined) children = mapChildren;\n } else if (children === undefined) {\n children = objectChildren;\n }\n\n var root = new Node(data),\n node,\n nodes = [root],\n child,\n childs,\n i,\n n;\n\n while (node = nodes.pop()) {\n if ((childs = children(node.data)) && (n = (childs = Array.from(childs)).length)) {\n node.children = childs;\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = childs[i] = new Node(childs[i]));\n child.parent = node;\n child.depth = node.depth + 1;\n }\n }\n }\n\n return root.eachBefore(computeHeight);\n}\n\nfunction node_copy() {\n return hierarchy(this).eachBefore(copyData);\n}\n\nfunction objectChildren(d) {\n return d.children;\n}\n\nfunction mapChildren(d) {\n return Array.isArray(d) ? d[1] : null;\n}\n\nfunction copyData(node) {\n if (node.data.value !== undefined) node.value = node.data.value;\n node.data = node.data.data;\n}\n\nexport function computeHeight(node) {\n var height = 0;\n do node.height = height;\n while ((node = node.parent) && (node.height < ++height));\n}\n\nexport function Node(data) {\n this.data = data;\n this.depth =\n this.height = 0;\n this.parent = null;\n}\n\nNode.prototype = hierarchy.prototype = {\n constructor: Node,\n count: node_count,\n each: node_each,\n eachAfter: node_eachAfter,\n eachBefore: node_eachBefore,\n find: node_find,\n sum: node_sum,\n sort: node_sort,\n path: node_path,\n ancestors: node_ancestors,\n descendants: node_descendants,\n leaves: node_leaves,\n links: node_links,\n copy: node_copy,\n [Symbol.iterator]: node_iterator\n};\n","export function optional(f) {\n return f == null ? null : required(f);\n}\n\nexport function required(f) {\n if (typeof f !== \"function\") throw new Error;\n return f;\n}\n","export function constantZero() {\n return 0;\n}\n\nexport default function(x) {\n return function() {\n return x;\n };\n}\n","// https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use\nconst a = 1664525;\nconst c = 1013904223;\nconst m = 4294967296; // 2^32\n\nexport default function() {\n let s = 1;\n return () => (s = (a * s + c) % m) / m;\n}\n","export 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\nexport function shuffle(array, random) {\n let m = array.length,\n t,\n i;\n\n while (m) {\n i = random() * m-- | 0;\n t = array[m];\n array[m] = array[i];\n array[i] = t;\n }\n\n return array;\n}\n","import {shuffle} from \"../array.js\";\nimport lcg from \"../lcg.js\";\n\nexport default function(circles) {\n return packEncloseRandom(circles, lcg());\n}\n\nexport function packEncloseRandom(circles, random) {\n var i = 0, n = (circles = shuffle(Array.from(circles), random)).length, B = [], p, e;\n\n while (i < n) {\n p = circles[i];\n if (e && enclosesWeak(e, p)) ++i;\n else e = encloseBasis(B = extendBasis(B, p)), i = 0;\n }\n\n return e;\n}\n\nfunction extendBasis(B, p) {\n var i, j;\n\n if (enclosesWeakAll(p, B)) return [p];\n\n // If we get here then B must have at least one element.\n for (i = 0; i < B.length; ++i) {\n if (enclosesNot(p, B[i])\n && enclosesWeakAll(encloseBasis2(B[i], p), B)) {\n return [B[i], p];\n }\n }\n\n // If we get here then B must have at least two elements.\n for (i = 0; i < B.length - 1; ++i) {\n for (j = i + 1; j < B.length; ++j) {\n if (enclosesNot(encloseBasis2(B[i], B[j]), p)\n && enclosesNot(encloseBasis2(B[i], p), B[j])\n && enclosesNot(encloseBasis2(B[j], p), B[i])\n && enclosesWeakAll(encloseBasis3(B[i], B[j], p), B)) {\n return [B[i], B[j], p];\n }\n }\n }\n\n // If we get here then something is very wrong.\n throw new Error;\n}\n\nfunction enclosesNot(a, b) {\n var dr = a.r - b.r, dx = b.x - a.x, dy = b.y - a.y;\n return dr < 0 || dr * dr < dx * dx + dy * dy;\n}\n\nfunction enclosesWeak(a, b) {\n var dr = a.r - b.r + Math.max(a.r, b.r, 1) * 1e-9, dx = b.x - a.x, dy = b.y - a.y;\n return dr > 0 && dr * dr > dx * dx + dy * dy;\n}\n\nfunction enclosesWeakAll(a, B) {\n for (var i = 0; i < B.length; ++i) {\n if (!enclosesWeak(a, B[i])) {\n return false;\n }\n }\n return true;\n}\n\nfunction encloseBasis(B) {\n switch (B.length) {\n case 1: return encloseBasis1(B[0]);\n case 2: return encloseBasis2(B[0], B[1]);\n case 3: return encloseBasis3(B[0], B[1], B[2]);\n }\n}\n\nfunction encloseBasis1(a) {\n return {\n x: a.x,\n y: a.y,\n r: a.r\n };\n}\n\nfunction encloseBasis2(a, b) {\n var x1 = a.x, y1 = a.y, r1 = a.r,\n x2 = b.x, y2 = b.y, r2 = b.r,\n x21 = x2 - x1, y21 = y2 - y1, r21 = r2 - r1,\n l = Math.sqrt(x21 * x21 + y21 * y21);\n return {\n x: (x1 + x2 + x21 / l * r21) / 2,\n y: (y1 + y2 + y21 / l * r21) / 2,\n r: (l + r1 + r2) / 2\n };\n}\n\nfunction encloseBasis3(a, b, c) {\n var x1 = a.x, y1 = a.y, r1 = a.r,\n x2 = b.x, y2 = b.y, r2 = b.r,\n x3 = c.x, y3 = c.y, r3 = c.r,\n a2 = x1 - x2,\n a3 = x1 - x3,\n b2 = y1 - y2,\n b3 = y1 - y3,\n c2 = r2 - r1,\n c3 = r3 - r1,\n d1 = x1 * x1 + y1 * y1 - r1 * r1,\n d2 = d1 - x2 * x2 - y2 * y2 + r2 * r2,\n d3 = d1 - x3 * x3 - y3 * y3 + r3 * r3,\n ab = a3 * b2 - a2 * b3,\n xa = (b2 * d3 - b3 * d2) / (ab * 2) - x1,\n xb = (b3 * c2 - b2 * c3) / ab,\n ya = (a3 * d2 - a2 * d3) / (ab * 2) - y1,\n yb = (a2 * c3 - a3 * c2) / ab,\n A = xb * xb + yb * yb - 1,\n B = 2 * (r1 + xa * xb + ya * yb),\n C = xa * xa + ya * ya - r1 * r1,\n r = -(Math.abs(A) > 1e-6 ? (B + Math.sqrt(B * B - 4 * A * C)) / (2 * A) : C / B);\n return {\n x: x1 + xa + xb * r,\n y: y1 + ya + yb * r,\n r: r\n };\n}\n","import array from \"../array.js\";\nimport lcg from \"../lcg.js\";\nimport {packEncloseRandom} from \"./enclose.js\";\n\nfunction place(b, a, c) {\n var dx = b.x - a.x, x, a2,\n dy = b.y - a.y, y, b2,\n d2 = dx * dx + dy * dy;\n if (d2) {\n a2 = a.r + c.r, a2 *= a2;\n b2 = b.r + c.r, b2 *= b2;\n if (a2 > b2) {\n x = (d2 + b2 - a2) / (2 * d2);\n y = Math.sqrt(Math.max(0, b2 / d2 - x * x));\n c.x = b.x - x * dx - y * dy;\n c.y = b.y - x * dy + y * dx;\n } else {\n x = (d2 + a2 - b2) / (2 * d2);\n y = Math.sqrt(Math.max(0, a2 / d2 - x * x));\n c.x = a.x + x * dx - y * dy;\n c.y = a.y + x * dy + y * dx;\n }\n } else {\n c.x = a.x + c.r;\n c.y = a.y;\n }\n}\n\nfunction intersects(a, b) {\n var dr = a.r + b.r - 1e-6, dx = b.x - a.x, dy = b.y - a.y;\n return dr > 0 && dr * dr > dx * dx + dy * dy;\n}\n\nfunction score(node) {\n var a = node._,\n b = node.next._,\n ab = a.r + b.r,\n dx = (a.x * b.r + b.x * a.r) / ab,\n dy = (a.y * b.r + b.y * a.r) / ab;\n return dx * dx + dy * dy;\n}\n\nfunction Node(circle) {\n this._ = circle;\n this.next = null;\n this.previous = null;\n}\n\nexport function packSiblingsRandom(circles, random) {\n if (!(n = (circles = array(circles)).length)) return 0;\n\n var a, b, c, n, aa, ca, i, j, k, sj, sk;\n\n // Place the first circle.\n a = circles[0], a.x = 0, a.y = 0;\n if (!(n > 1)) return a.r;\n\n // Place the second circle.\n b = circles[1], a.x = -b.r, b.x = a.r, b.y = 0;\n if (!(n > 2)) return a.r + b.r;\n\n // Place the third circle.\n place(b, a, c = circles[2]);\n\n // Initialize the front-chain using the first three circles a, b and c.\n a = new Node(a), b = new Node(b), c = new Node(c);\n a.next = c.previous = b;\n b.next = a.previous = c;\n c.next = b.previous = a;\n\n // Attempt to place each remaining circle…\n pack: for (i = 3; i < n; ++i) {\n place(a._, b._, c = circles[i]), c = new Node(c);\n\n // Find the closest intersecting circle on the front-chain, if any.\n // “Closeness” is determined by linear distance along the front-chain.\n // “Ahead” or “behind” is likewise determined by linear distance.\n j = b.next, k = a.previous, sj = b._.r, sk = a._.r;\n do {\n if (sj <= sk) {\n if (intersects(j._, c._)) {\n b = j, a.next = b, b.previous = a, --i;\n continue pack;\n }\n sj += j._.r, j = j.next;\n } else {\n if (intersects(k._, c._)) {\n a = k, a.next = b, b.previous = a, --i;\n continue pack;\n }\n sk += k._.r, k = k.previous;\n }\n } while (j !== k.next);\n\n // Success! Insert the new circle c between a and b.\n c.previous = a, c.next = b, a.next = b.previous = b = c;\n\n // Compute the new closest circle pair to the centroid.\n aa = score(a);\n while ((c = c.next) !== b) {\n if ((ca = score(c)) < aa) {\n a = c, aa = ca;\n }\n }\n b = a.next;\n }\n\n // Compute the enclosing circle of the front chain.\n a = [b._], c = b; while ((c = c.next) !== b) a.push(c._); c = packEncloseRandom(a, random);\n\n // Translate the circles to put the enclosing circle around the origin.\n for (i = 0; i < n; ++i) a = circles[i], a.x -= c.x, a.y -= c.y;\n\n return c.r;\n}\n\nexport default function(circles) {\n packSiblingsRandom(circles, lcg());\n return circles;\n}\n","import {optional} from \"../accessors.js\";\nimport constant, {constantZero} from \"../constant.js\";\nimport lcg from \"../lcg.js\";\nimport {packSiblingsRandom} from \"./siblings.js\";\n\nfunction defaultRadius(d) {\n return Math.sqrt(d.value);\n}\n\nexport default function() {\n var radius = null,\n dx = 1,\n dy = 1,\n padding = constantZero;\n\n function pack(root) {\n const random = lcg();\n root.x = dx / 2, root.y = dy / 2;\n if (radius) {\n root.eachBefore(radiusLeaf(radius))\n .eachAfter(packChildrenRandom(padding, 0.5, random))\n .eachBefore(translateChild(1));\n } else {\n root.eachBefore(radiusLeaf(defaultRadius))\n .eachAfter(packChildrenRandom(constantZero, 1, random))\n .eachAfter(packChildrenRandom(padding, root.r / Math.min(dx, dy), random))\n .eachBefore(translateChild(Math.min(dx, dy) / (2 * root.r)));\n }\n return root;\n }\n\n pack.radius = function(x) {\n return arguments.length ? (radius = optional(x), pack) : radius;\n };\n\n pack.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], pack) : [dx, dy];\n };\n\n pack.padding = function(x) {\n return arguments.length ? (padding = typeof x === \"function\" ? x : constant(+x), pack) : padding;\n };\n\n return pack;\n}\n\nfunction radiusLeaf(radius) {\n return function(node) {\n if (!node.children) {\n node.r = Math.max(0, +radius(node) || 0);\n }\n };\n}\n\nfunction packChildrenRandom(padding, k, random) {\n return function(node) {\n if (children = node.children) {\n var children,\n i,\n n = children.length,\n r = padding(node) * k || 0,\n e;\n\n if (r) for (i = 0; i < n; ++i) children[i].r += r;\n e = packSiblingsRandom(children, random);\n if (r) for (i = 0; i < n; ++i) children[i].r -= r;\n node.r = e + r;\n }\n };\n}\n\nfunction translateChild(k) {\n return function(node) {\n var parent = node.parent;\n node.r *= k;\n if (parent) {\n node.x = parent.x + k * node.x;\n node.y = parent.y + k * node.y;\n }\n };\n}\n","export default function(node) {\n node.x0 = Math.round(node.x0);\n node.y0 = Math.round(node.y0);\n node.x1 = Math.round(node.x1);\n node.y1 = Math.round(node.y1);\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n node,\n i = -1,\n n = nodes.length,\n k = parent.value && (x1 - x0) / parent.value;\n\n while (++i < n) {\n node = nodes[i], node.y0 = y0, node.y1 = y1;\n node.x0 = x0, node.x1 = x0 += node.value * k;\n }\n}\n","import {Node} from \"./hierarchy/index.js\";\n\nfunction defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\n// function radialSeparation(a, b) {\n// return (a.parent === b.parent ? 1 : 2) / a.depth;\n// }\n\n// This function is used to traverse the left contour of a subtree (or\n// subforest). It returns the successor of v on this contour. This successor is\n// either given by the leftmost child of v or by the thread of v. The function\n// returns null if and only if v is on the highest level of its subtree.\nfunction nextLeft(v) {\n var children = v.children;\n return children ? children[0] : v.t;\n}\n\n// This function works analogously to nextLeft.\nfunction nextRight(v) {\n var children = v.children;\n return children ? children[children.length - 1] : v.t;\n}\n\n// Shifts the current subtree rooted at w+. This is done by increasing\n// prelim(w+) and mod(w+) by shift.\nfunction moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}\n\n// All other shifts, applied to the smaller subtrees between w- and w+, are\n// performed by this function. To prepare the shifts, we have to adjust\n// change(w+), shift(w+), and change(w-).\nfunction executeShifts(v) {\n var shift = 0,\n change = 0,\n children = v.children,\n i = children.length,\n w;\n while (--i >= 0) {\n w = children[i];\n w.z += shift;\n w.m += shift;\n shift += w.s + (change += w.c);\n }\n}\n\n// If vi-’s ancestor is a sibling of v, returns vi-’s ancestor. Otherwise,\n// returns the specified (default) ancestor.\nfunction nextAncestor(vim, v, ancestor) {\n return vim.a.parent === v.parent ? vim.a : ancestor;\n}\n\nfunction TreeNode(node, i) {\n this._ = node;\n this.parent = null;\n this.children = null;\n this.A = null; // default ancestor\n this.a = this; // ancestor\n this.z = 0; // prelim\n this.m = 0; // mod\n this.c = 0; // change\n this.s = 0; // shift\n this.t = null; // thread\n this.i = i; // number\n}\n\nTreeNode.prototype = Object.create(Node.prototype);\n\nfunction treeRoot(root) {\n var tree = new TreeNode(root, 0),\n node,\n nodes = [tree],\n child,\n children,\n i,\n n;\n\n while (node = nodes.pop()) {\n if (children = node._.children) {\n node.children = new Array(n = children.length);\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = node.children[i] = new TreeNode(children[i], i));\n child.parent = node;\n }\n }\n }\n\n (tree.parent = new TreeNode(null, 0)).children = [tree];\n return tree;\n}\n\n// Node-link tree diagram using the Reingold-Tilford \"tidy\" algorithm\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n node,\n i = -1,\n n = nodes.length,\n k = parent.value && (y1 - y0) / parent.value;\n\n while (++i < n) {\n node = nodes[i], node.x0 = x0, node.x1 = x1;\n node.y0 = y0, node.y1 = y0 += node.value * k;\n }\n}\n","import treemapDice from \"./dice.js\";\nimport treemapSlice from \"./slice.js\";\n\nexport var phi = (1 + Math.sqrt(5)) / 2;\n\nexport function squarifyRatio(ratio, parent, x0, y0, x1, y1) {\n var rows = [],\n nodes = parent.children,\n row,\n nodeValue,\n i0 = 0,\n i1 = 0,\n n = nodes.length,\n dx, dy,\n value = parent.value,\n sumValue,\n minValue,\n maxValue,\n newRatio,\n minRatio,\n alpha,\n beta;\n\n while (i0 < n) {\n dx = x1 - x0, dy = y1 - y0;\n\n // Find the next non-empty node.\n do sumValue = nodes[i1++].value; while (!sumValue && i1 < n);\n minValue = maxValue = sumValue;\n alpha = Math.max(dy / dx, dx / dy) / (value * ratio);\n beta = sumValue * sumValue * alpha;\n minRatio = Math.max(maxValue / beta, beta / minValue);\n\n // Keep adding nodes while the aspect ratio maintains or improves.\n for (; i1 < n; ++i1) {\n sumValue += nodeValue = nodes[i1].value;\n if (nodeValue < minValue) minValue = nodeValue;\n if (nodeValue > maxValue) maxValue = nodeValue;\n beta = sumValue * sumValue * alpha;\n newRatio = Math.max(maxValue / beta, beta / minValue);\n if (newRatio > minRatio) { sumValue -= nodeValue; break; }\n minRatio = newRatio;\n }\n\n // Position and record the row orientation.\n rows.push(row = {value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1)});\n if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);\n else treemapSlice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);\n value -= sumValue, i0 = i1;\n }\n\n return rows;\n}\n\nexport default (function custom(ratio) {\n\n function squarify(parent, x0, y0, x1, y1) {\n squarifyRatio(ratio, parent, x0, y0, x1, y1);\n }\n\n squarify.ratio = function(x) {\n return custom((x = +x) > 1 ? x : 1);\n };\n\n return squarify;\n})(phi);\n","import roundNode from \"./round.js\";\nimport squarify from \"./squarify.js\";\nimport {required} from \"../accessors.js\";\nimport constant, {constantZero} from \"../constant.js\";\n\nexport default function() {\n var tile = squarify,\n round = false,\n dx = 1,\n dy = 1,\n paddingStack = [0],\n paddingInner = constantZero,\n paddingTop = constantZero,\n paddingRight = constantZero,\n paddingBottom = constantZero,\n paddingLeft = constantZero;\n\n function treemap(root) {\n root.x0 =\n root.y0 = 0;\n root.x1 = dx;\n root.y1 = dy;\n root.eachBefore(positionNode);\n paddingStack = [0];\n if (round) root.eachBefore(roundNode);\n return root;\n }\n\n function positionNode(node) {\n var p = paddingStack[node.depth],\n x0 = node.x0 + p,\n y0 = node.y0 + p,\n x1 = node.x1 - p,\n y1 = node.y1 - p;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n node.x0 = x0;\n node.y0 = y0;\n node.x1 = x1;\n node.y1 = y1;\n if (node.children) {\n p = paddingStack[node.depth + 1] = paddingInner(node) / 2;\n x0 += paddingLeft(node) - p;\n y0 += paddingTop(node) - p;\n x1 -= paddingRight(node) - p;\n y1 -= paddingBottom(node) - p;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n tile(node, x0, y0, x1, y1);\n }\n }\n\n treemap.round = function(x) {\n return arguments.length ? (round = !!x, treemap) : round;\n };\n\n treemap.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];\n };\n\n treemap.tile = function(x) {\n return arguments.length ? (tile = required(x), treemap) : tile;\n };\n\n treemap.padding = function(x) {\n return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();\n };\n\n treemap.paddingInner = function(x) {\n return arguments.length ? (paddingInner = typeof x === \"function\" ? x : constant(+x), treemap) : paddingInner;\n };\n\n treemap.paddingOuter = function(x) {\n return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();\n };\n\n treemap.paddingTop = function(x) {\n return arguments.length ? (paddingTop = typeof x === \"function\" ? x : constant(+x), treemap) : paddingTop;\n };\n\n treemap.paddingRight = function(x) {\n return arguments.length ? (paddingRight = typeof x === \"function\" ? x : constant(+x), treemap) : paddingRight;\n };\n\n treemap.paddingBottom = function(x) {\n return arguments.length ? (paddingBottom = typeof x === \"function\" ? x : constant(+x), treemap) : paddingBottom;\n };\n\n treemap.paddingLeft = function(x) {\n return arguments.length ? (paddingLeft = typeof x === \"function\" ? x : constant(+x), treemap) : paddingLeft;\n };\n\n return treemap;\n}\n","export function initRange(domain, range) {\n switch (arguments.length) {\n case 0: break;\n case 1: this.range(domain); break;\n default: this.range(range).domain(domain); break;\n }\n return this;\n}\n\nexport function initInterpolator(domain, interpolator) {\n switch (arguments.length) {\n case 0: break;\n case 1: {\n if (typeof domain === \"function\") this.interpolator(domain);\n else this.range(domain);\n break;\n }\n default: {\n this.domain(domain);\n if (typeof interpolator === \"function\") this.interpolator(interpolator);\n else this.range(interpolator);\n break;\n }\n }\n return this;\n}\n","import {InternMap} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport const implicit = Symbol(\"implicit\");\n\nexport default function ordinal() {\n var index = new InternMap(),\n domain = [],\n range = [],\n unknown = implicit;\n\n function scale(d) {\n let i = index.get(d);\n if (i === undefined) {\n if (unknown !== implicit) return unknown;\n index.set(d, i = domain.push(d) - 1);\n }\n return range[i % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = new InternMap();\n for (const value of _) {\n if (index.has(value)) continue;\n index.set(value, domain.push(value) - 1);\n }\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal(domain, range).unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n","import {range as sequence} from \"d3-array\";\nimport {initRange} from \"./init.js\";\nimport ordinal from \"./ordinal.js\";\n\nexport default function band() {\n var scale = ordinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range,\n r0 = 0,\n r1 = 1,\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n\n delete scale.unknown;\n\n function rescale() {\n var n = domain().length,\n reverse = r1 < r0,\n start = reverse ? r1 : r0,\n stop = reverse ? r0 : r1;\n step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);\n if (round) step = Math.floor(step);\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);\n var values = sequence(n).map(function(i) { return start + step * i; });\n return ordinalRange(reverse ? values.reverse() : values);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];\n };\n\n scale.rangeRound = function(_) {\n return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();\n };\n\n scale.bandwidth = function() {\n return bandwidth;\n };\n\n scale.step = function() {\n return step;\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, rescale()) : round;\n };\n\n scale.padding = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;\n };\n\n scale.paddingInner = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;\n };\n\n scale.paddingOuter = function(_) {\n return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;\n };\n\n scale.align = function(_) {\n return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;\n };\n\n scale.copy = function() {\n return band(domain(), [r0, r1])\n .round(round)\n .paddingInner(paddingInner)\n .paddingOuter(paddingOuter)\n .align(align);\n };\n\n return initRange.apply(rescale(), arguments);\n}\n\nfunction pointish(scale) {\n var copy = scale.copy;\n\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n delete scale.paddingOuter;\n\n scale.copy = function() {\n return pointish(copy());\n };\n\n return scale;\n}\n\nexport function point() {\n return pointish(band.apply(null, arguments).paddingInner(1));\n}\n","export default function constants(x) {\n return function() {\n return x;\n };\n}\n","export default function number(x) {\n return +x;\n}\n","import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateNumber, interpolateRound} from \"d3-interpolate\";\nimport constant from \"./constant.js\";\nimport number from \"./number.js\";\n\nvar unit = [0, 1];\n\nexport function identity(x) {\n return x;\n}\n\nfunction normalize(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(isNaN(b) ? NaN : 0.5);\n}\n\nfunction clamper(a, b) {\n var t;\n if (a > b) t = a, a = b, b = t;\n return function(x) { return Math.max(a, Math.min(b, x)); };\n}\n\n// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].\nfunction bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, interpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = normalize(domain[i], domain[i + 1]);\n r[i] = interpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport function transformer() {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n transform,\n untransform,\n unknown,\n clamp = identity,\n piecewise,\n output,\n input;\n\n function rescale() {\n var n = Math.min(domain.length, range.length);\n if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);\n piecewise = n > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));\n }\n\n scale.invert = function(y) {\n return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = Array.from(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t, u) {\n transform = t, untransform = u;\n return rescale();\n };\n}\n\nexport default function continuous() {\n return transformer()(identity, identity);\n}\n","import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function tickFormat(start, stop, count, specifier) {\n var step = tickStep(start, stop, count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n","import {ticks, tickIncrement} from \"d3-array\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport tickFormat from \"./tickFormat.js\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n var d = domain();\n return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain();\n var i0 = 0;\n var i1 = d.length - 1;\n var start = d[i0];\n var stop = d[i1];\n var prestep;\n var step;\n var maxIter = 10;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n \n while (maxIter-- > 0) {\n step = tickIncrement(start, stop, count);\n if (step === prestep) {\n d[i0] = start\n d[i1] = stop\n return domain(d);\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 } else {\n break;\n }\n prestep = step;\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous();\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n","export default function nice(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n","import {ticks} from \"d3-array\";\nimport {format, formatSpecifier} from \"d3-format\";\nimport nice from \"./nice.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformLog(x) {\n return Math.log(x);\n}\n\nfunction transformExp(x) {\n return Math.exp(x);\n}\n\nfunction transformLogn(x) {\n return -Math.log(-x);\n}\n\nfunction transformExpn(x) {\n return -Math.exp(-x);\n}\n\nfunction pow10(x) {\n return isFinite(x) ? +(\"1e\" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n return base === 10 ? pow10\n : base === Math.E ? Math.exp\n : x => Math.pow(base, x);\n}\n\nfunction logp(base) {\n return base === Math.E ? Math.log\n : base === 10 && Math.log10\n || base === 2 && Math.log2\n || (base = Math.log(base), x => Math.log(x) / base);\n}\n\nfunction reflect(f) {\n return (x, k) => -f(-x, k);\n}\n\nexport function loggish(transform) {\n const scale = transform(transformLog, transformExp);\n const domain = scale.domain;\n let base = 10;\n let logs;\n let pows;\n\n function rescale() {\n logs = logp(base), pows = powp(base);\n if (domain()[0] < 0) {\n logs = reflect(logs), pows = reflect(pows);\n transform(transformLogn, transformExpn);\n } else {\n transform(transformLog, transformExp);\n }\n return scale;\n }\n\n scale.base = function(_) {\n return arguments.length ? (base = +_, rescale()) : base;\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.ticks = count => {\n const d = domain();\n let u = d[0];\n let v = d[d.length - 1];\n const r = v < u;\n\n if (r) ([u, v] = [v, u]);\n\n let i = logs(u);\n let j = logs(v);\n let k;\n let t;\n const n = count == null ? 10 : +count;\n let z = [];\n\n if (!(base % 1) && j - i < n) {\n i = Math.floor(i), j = Math.ceil(j);\n if (u > 0) for (; i <= j; ++i) {\n for (k = 1; k < base; ++k) {\n t = i < 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n } else for (; i <= j; ++i) {\n for (k = base - 1; k >= 1; --k) {\n t = i > 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n }\n if (z.length * 2 < n) z = ticks(u, v, n);\n } else {\n z = ticks(i, j, Math.min(j - i, n)).map(pows);\n }\n return r ? z.reverse() : z;\n };\n\n scale.tickFormat = (count, specifier) => {\n if (count == null) count = 10;\n if (specifier == null) specifier = base === 10 ? \"s\" : \",\";\n if (typeof specifier !== \"function\") {\n if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true;\n specifier = format(specifier);\n }\n if (count === Infinity) return specifier;\n const k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n return d => {\n let i = d / pows(Math.round(logs(d)));\n if (i * base < base - 0.5) i *= base;\n return i <= k ? specifier(d) : \"\";\n };\n };\n\n scale.nice = () => {\n return domain(nice(domain(), {\n floor: x => pows(Math.floor(logs(x))),\n ceil: x => pows(Math.ceil(logs(x)))\n }));\n };\n\n return scale;\n}\n\nexport default function log() {\n const scale = loggish(transformer()).domain([1, 10]);\n scale.copy = () => copy(scale, log()).base(scale.base());\n initRange.apply(scale, arguments);\n return scale;\n}\n","import {bisect} from \"d3-array\";\nimport {linearish} from \"./linear.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantize() {\n var x0 = 0,\n x1 = 1,\n n = 1,\n domain = [0.5],\n range = [0, 1],\n unknown;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n function rescale() {\n var i = -1;\n domain = new Array(n);\n while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);\n return scale;\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1];\n };\n\n scale.range = function(_) {\n return arguments.length ? (n = (range = Array.from(_)).length - 1, rescale()) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN]\n : i < 1 ? [x0, domain[0]]\n : i >= n ? [domain[n - 1], x1]\n : [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : scale;\n };\n\n scale.thresholds = function() {\n return domain.slice();\n };\n\n scale.copy = function() {\n return quantize()\n .domain([x0, x1])\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(linearish(scale), arguments);\n}\n","const t0 = new Date, t1 = new Date;\n\nexport function timeInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = (date) => {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = (date) => {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = (date) => {\n const d0 = interval(date), d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = (date, step) => {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = (start, stop, step) => {\n const range = [];\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n let previous;\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = (test) => {\n return timeInterval((date) => {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, (date, step) => {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = (start, end) => {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = (step) => {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? (d) => field(d) % step === 0\n : (d) => interval.count(0, d) % step === 0);\n };\n }\n\n return interval;\n}\n","import {timeInterval} from \"./interval.js\";\n\nexport const millisecond = timeInterval(() => {\n // noop\n}, (date, step) => {\n date.setTime(+date + step);\n}, (start, end) => {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = (k) => {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return timeInterval((date) => {\n date.setTime(Math.floor(date / k) * k);\n }, (date, step) => {\n date.setTime(+date + step * k);\n }, (start, end) => {\n return (end - start) / k;\n });\n};\n\nexport const milliseconds = millisecond.range;\n","export const durationSecond = 1000;\nexport const durationMinute = durationSecond * 60;\nexport const durationHour = durationMinute * 60;\nexport const durationDay = durationHour * 24;\nexport const durationWeek = durationDay * 7;\nexport const durationMonth = durationDay * 30;\nexport const durationYear = durationDay * 365;\n","import {timeInterval} from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nexport const second = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds());\n}, (date, step) => {\n date.setTime(+date + step * durationSecond);\n}, (start, end) => {\n return (end - start) / durationSecond;\n}, (date) => {\n return date.getUTCSeconds();\n});\n\nexport const seconds = second.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeMinute = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getMinutes();\n});\n\nexport const timeMinutes = timeMinute.range;\n\nexport const utcMinute = timeInterval((date) => {\n date.setUTCSeconds(0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getUTCMinutes();\n});\n\nexport const utcMinutes = utcMinute.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeHour = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getHours();\n});\n\nexport const timeHours = timeHour.range;\n\nexport const utcHour = timeInterval((date) => {\n date.setUTCMinutes(0, 0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getUTCHours();\n});\n\nexport const utcHours = utcHour.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nexport const timeDay = timeInterval(\n date => date.setHours(0, 0, 0, 0),\n (date, step) => date.setDate(date.getDate() + step),\n (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,\n date => date.getDate() - 1\n);\n\nexport const timeDays = timeDay.range;\n\nexport const utcDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return date.getUTCDate() - 1;\n});\n\nexport const utcDays = utcDay.range;\n\nexport const unixDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return Math.floor(date / durationDay);\n});\n\nexport const unixDays = unixDay.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction timeWeekday(i) {\n return timeInterval((date) => {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setDate(date.getDate() + step * 7);\n }, (start, end) => {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport const timeSunday = timeWeekday(0);\nexport const timeMonday = timeWeekday(1);\nexport const timeTuesday = timeWeekday(2);\nexport const timeWednesday = timeWeekday(3);\nexport const timeThursday = timeWeekday(4);\nexport const timeFriday = timeWeekday(5);\nexport const timeSaturday = timeWeekday(6);\n\nexport const timeSundays = timeSunday.range;\nexport const timeMondays = timeMonday.range;\nexport const timeTuesdays = timeTuesday.range;\nexport const timeWednesdays = timeWednesday.range;\nexport const timeThursdays = timeThursday.range;\nexport const timeFridays = timeFriday.range;\nexport const timeSaturdays = timeSaturday.range;\n\nfunction utcWeekday(i) {\n return timeInterval((date) => {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, (start, end) => {\n return (end - start) / durationWeek;\n });\n}\n\nexport const utcSunday = utcWeekday(0);\nexport const utcMonday = utcWeekday(1);\nexport const utcTuesday = utcWeekday(2);\nexport const utcWednesday = utcWeekday(3);\nexport const utcThursday = utcWeekday(4);\nexport const utcFriday = utcWeekday(5);\nexport const utcSaturday = utcWeekday(6);\n\nexport const utcSundays = utcSunday.range;\nexport const utcMondays = utcMonday.range;\nexport const utcTuesdays = utcTuesday.range;\nexport const utcWednesdays = utcWednesday.range;\nexport const utcThursdays = utcThursday.range;\nexport const utcFridays = utcFriday.range;\nexport const utcSaturdays = utcSaturday.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeMonth = timeInterval((date) => {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setMonth(date.getMonth() + step);\n}, (start, end) => {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, (date) => {\n return date.getMonth();\n});\n\nexport const timeMonths = timeMonth.range;\n\nexport const utcMonth = timeInterval((date) => {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, (start, end) => {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, (date) => {\n return date.getUTCMonth();\n});\n\nexport const utcMonths = utcMonth.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeYear = timeInterval((date) => {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setFullYear(date.getFullYear() + step);\n}, (start, end) => {\n return end.getFullYear() - start.getFullYear();\n}, (date) => {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\ntimeYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport const timeYears = timeYear.range;\n\nexport const utcYear = timeInterval((date) => {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, (start, end) => {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, (date) => {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport const utcYears = utcYear.range;\n","import {bisector, tickStep} from \"d3-array\";\nimport {durationDay, durationHour, durationMinute, durationMonth, durationSecond, durationWeek, durationYear} from \"./duration.js\";\nimport {millisecond} from \"./millisecond.js\";\nimport {second} from \"./second.js\";\nimport {timeMinute, utcMinute} from \"./minute.js\";\nimport {timeHour, utcHour} from \"./hour.js\";\nimport {timeDay, unixDay} from \"./day.js\";\nimport {timeSunday, utcSunday} from \"./week.js\";\nimport {timeMonth, utcMonth} from \"./month.js\";\nimport {timeYear, utcYear} from \"./year.js\";\n\nfunction ticker(year, month, week, day, hour, minute) {\n\n const tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function ticks(start, stop, count) {\n const reverse = stop < start;\n if (reverse) [start, stop] = [stop, start];\n const interval = count && typeof count.range === \"function\" ? count : tickInterval(start, stop, count);\n const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop\n return reverse ? ticks.reverse() : ticks;\n }\n\n function tickInterval(start, stop, count) {\n const target = Math.abs(stop - start) / count;\n const i = bisector(([,, step]) => step).right(tickIntervals, target);\n if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));\n if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));\n const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n return t.every(step);\n }\n\n return [ticks, tickInterval];\n}\n\nconst [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);\nconst [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);\n\nexport {utcTicks, utcTickInterval, timeTicks, timeTickInterval};\n","import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newDate(y, m, d) {\n return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"g\": formatYearISO,\n \"G\": formatFullYearISO,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"q\": formatQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"g\": formatUTCYearISO,\n \"G\": formatUTCFullYearISO,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"q\": formatUTCQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"g\": parseYear,\n \"G\": parseFullYear,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"q\": parseQuarter,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, Z) {\n return function(string) {\n var d = newDate(1900, undefined, 1),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n if (\"s\" in d) return new Date(d.s * 1000 + (\"L\" in d ? d.L : 0));\n\n // If this is utcParse, never use the local timezone.\n if (Z && !(\"Z\" in d)) d.Z = 0;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // If the month was not specified, inherit from the quarter.\n if (d.m === undefined) d.m = \"q\" in d ? d.q : 0;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = localDate(newDate(d.y, 0, 1)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return localDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatQuarter(d) {\n return 1 + ~~(d.getMonth() / 3);\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n function formatUTCQuarter(d) {\n return 1 + ~~(d.getUTCMonth() / 3);\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", false);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier += \"\", true);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n return new Map(names.map((name, i) => [name.toLowerCase(), i]));\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseQuarter(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.s = +n[0], i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction dISO(d) {\n var day = d.getDay();\n return (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n}\n\nfunction formatWeekNumberISO(d, p) {\n d = dISO(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatYearISO(d, p) {\n d = dISO(d);\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatFullYearISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction UTCdISO(d) {\n var day = d.getUTCDay();\n return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n d = UTCdISO(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCYearISO(d, p) {\n d = UTCdISO(d);\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCFullYearISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n","import {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeTicks, timeTickInterval} from \"d3-time\";\nimport {timeFormat} from \"d3-time-format\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport nice from \"./nice.js\";\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nexport function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {\n var scale = continuous(),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(Array.from(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval) {\n var d = domain();\n if (!interval || typeof interval.range !== \"function\") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);\n return interval ? domain(nice(d, interval)) : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));\n };\n\n return scale;\n}\n\nexport default function time() {\n return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);\n}\n","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","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","export default function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n","export default function(d) {\n return d;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport descending from \"./descending.js\";\nimport identity from \"./identity.js\";\nimport {tau} from \"./math.js\";\n\nexport default function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = (data = array(data)).length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\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 pointRadial from \"../pointRadial.js\";\n\nclass Bump {\n constructor(context, x) {\n this._context = context;\n this._x = x;\n }\n areaStart() {\n this._line = 0;\n }\n areaEnd() {\n this._line = NaN;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n }\n point(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: {\n this._point = 1;\n if (this._line) this._context.lineTo(x, y);\n else this._context.moveTo(x, y);\n break;\n }\n case 1: this._point = 2; // falls through\n default: {\n if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x) / 2, this._y0, this._x0, y, x, y);\n else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y) / 2, x, this._y0, x, y);\n break;\n }\n }\n this._x0 = x, this._y0 = y;\n }\n}\n\nclass BumpRadial {\n constructor(context) {\n this._context = context;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {}\n point(x, y) {\n x = +x, y = +y;\n if (this._point === 0) {\n this._point = 1;\n } else {\n const p0 = pointRadial(this._x0, this._y0);\n const p1 = pointRadial(this._x0, this._y0 = (this._y0 + y) / 2);\n const p2 = pointRadial(x, this._y0);\n const p3 = pointRadial(x, y);\n this._context.moveTo(...p0);\n this._context.bezierCurveTo(...p1, ...p2, ...p3);\n }\n this._x0 = x, this._y0 = y;\n }\n}\n\nexport function bumpX(context) {\n return new Bump(context, true);\n}\n\nexport function bumpY(context) {\n return new Bump(context, false);\n}\n\nexport function bumpRadial(context) {\n return new BumpRadial(context);\n}\n","import {slice} from \"./array.js\";\nimport constant from \"./constant.js\";\nimport {bumpX, bumpY, bumpRadial} from \"./curve/bump.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nfunction linkSource(d) {\n return d.source;\n}\n\nfunction linkTarget(d) {\n return d.target;\n}\n\nexport function link(curve) {\n let source = linkSource,\n target = linkTarget,\n x = pointX,\n y = pointY,\n context = null,\n output = null,\n path = withPath(link);\n\n function link() {\n let buffer;\n const argv = slice.call(arguments);\n const s = source.apply(this, argv);\n const t = target.apply(this, argv);\n if (context == null) output = curve(buffer = path());\n output.lineStart();\n argv[0] = s, output.point(+x.apply(this, argv), +y.apply(this, argv));\n argv[0] = t, output.point(+x.apply(this, argv), +y.apply(this, argv));\n output.lineEnd();\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n link.source = function(_) {\n return arguments.length ? (source = _, link) : source;\n };\n\n link.target = function(_) {\n return arguments.length ? (target = _, link) : target;\n };\n\n link.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), link) : x;\n };\n\n link.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), link) : y;\n };\n\n link.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), link) : context;\n };\n\n return link;\n}\n\nexport function linkHorizontal() {\n return link(bumpX);\n}\n\nexport function linkVertical() {\n return link(bumpY);\n}\n\nexport function linkRadial() {\n const l = link(bumpRadial);\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n return l;\n}\n","export default function() {}\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nexport function Basis(context) {\n this._context = context;\n}\n\nBasis.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 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // falls through\n case 2: this._context.lineTo(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; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new Basis(context);\n}\n","import noop from \"../noop.js\";\nimport {point} from \"./basis.js\";\n\nfunction BasisClosed(context) {\n this._context = context;\n}\n\nBasisClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x2, this._y2);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x2, this._y2);\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\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._x2 = x, this._y2 = y; break;\n case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisClosed(context);\n}\n","import {point} from \"./basis.js\";\n\nfunction BasisOpen(context) {\n this._context = context;\n}\n\nBasisOpen.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 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) 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; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisOpen(context);\n}\n","import {Basis} from \"./basis.js\";\n\nfunction Bundle(context, beta) {\n this._basis = new Basis(context);\n this._beta = beta;\n}\n\nBundle.prototype = {\n lineStart: function() {\n this._x = [];\n this._y = [];\n this._basis.lineStart();\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n j = x.length - 1;\n\n if (j > 0) {\n var x0 = x[0],\n y0 = y[0],\n dx = x[j] - x0,\n dy = y[j] - y0,\n i = -1,\n t;\n\n while (++i <= j) {\n t = i / j;\n this._basis.point(\n this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n );\n }\n }\n\n this._x = this._y = null;\n this._basis.lineEnd();\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\nexport default (function custom(beta) {\n\n function bundle(context) {\n return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n }\n\n bundle.beta = function(beta) {\n return custom(+beta);\n };\n\n return bundle;\n})(0.85);\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 {point} from \"./cardinal.js\";\n\nexport function CardinalOpen(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalOpen.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 if (this._line || (this._line !== 0 && this._point === 3)) 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; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // 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 CardinalOpen(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 {CardinalOpen} from \"./cardinalOpen.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomOpen(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomOpen.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 if (this._line || (this._line !== 0 && this._point === 3)) 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; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // 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 CatmullRomOpen(context, alpha) : new CardinalOpen(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 Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nexport default function(context) {\n return new Natural(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 default function(series, order) {\n if (!((n = series.length) > 1)) return;\n for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {\n s0 = s1, s1 = series[order[i]];\n for (j = 0; j < m; ++j) {\n s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];\n }\n }\n}\n","export default function(series) {\n var n = series.length, o = new Array(n);\n while (--n >= 0) o[n] = n;\n return o;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport offsetNone from \"./offset/none.js\";\nimport orderNone from \"./order/none.js\";\n\nfunction stackValue(d, key) {\n return d[key];\n}\n\nfunction stackSeries(key) {\n const series = [];\n series.key = key;\n return series;\n}\n\nexport default function() {\n var keys = constant([]),\n order = orderNone,\n offset = offsetNone,\n value = stackValue;\n\n function stack(data) {\n var sz = Array.from(keys.apply(this, arguments), stackSeries),\n i, n = sz.length, j = -1,\n oz;\n\n for (const d of data) {\n for (i = 0, ++j; i < n; ++i) {\n (sz[i][j] = [0, +value(d, sz[i].key, j, data)]).data = d;\n }\n }\n\n for (i = 0, oz = array(order(sz)); i < n; ++i) {\n sz[oz[i]].index = i;\n }\n\n offset(sz, oz);\n return sz;\n }\n\n stack.keys = function(_) {\n return arguments.length ? (keys = typeof _ === \"function\" ? _ : constant(Array.from(_)), stack) : keys;\n };\n\n stack.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), stack) : value;\n };\n\n stack.order = function(_) {\n return arguments.length ? (order = _ == null ? orderNone : typeof _ === \"function\" ? _ : constant(Array.from(_)), stack) : order;\n };\n\n stack.offset = function(_) {\n return arguments.length ? (offset = _ == null ? offsetNone : _, stack) : offset;\n };\n\n return stack;\n}\n","export default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) {\n for (yp = yn = 0, i = 0; i < n; ++i) {\n if ((dy = (d = series[order[i]][j])[1] - d[0]) > 0) {\n d[0] = yp, d[1] = yp += dy;\n } else if (dy < 0) {\n d[1] = yn, d[0] = yn += dy;\n } else {\n d[0] = 0, d[1] = dy;\n }\n }\n }\n}\n","export function Transform(k, x, y) {\n this.k = k;\n this.x = x;\n this.y = y;\n}\n\nTransform.prototype = {\n constructor: Transform,\n scale: function(k) {\n return k === 1 ? this : new Transform(this.k * k, this.x, this.y);\n },\n translate: function(x, y) {\n return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);\n },\n apply: function(point) {\n return [point[0] * this.k + this.x, point[1] * this.k + this.y];\n },\n applyX: function(x) {\n return x * this.k + this.x;\n },\n applyY: function(y) {\n return y * this.k + this.y;\n },\n invert: function(location) {\n return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];\n },\n invertX: function(x) {\n return (x - this.x) / this.k;\n },\n invertY: function(y) {\n return (y - this.y) / this.k;\n },\n rescaleX: function(x) {\n return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));\n },\n rescaleY: function(y) {\n return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));\n },\n toString: function() {\n return \"translate(\" + this.x + \",\" + this.y + \") scale(\" + this.k + \")\";\n }\n};\n\nexport var identity = new Transform(1, 0, 0);\n\ntransform.prototype = Transform.prototype;\n\nexport default function transform(node) {\n while (!node.__zoom) if (!(node = node.parentNode)) return identity;\n return node.__zoom;\n}\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nexport default isSymbol;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nexport default arrayMap;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n","import Symbol from './_Symbol.js';\nimport arrayMap from './_arrayMap.js';\nimport isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default baseToString;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nexport default trimmedEndIndex;\n","import trimmedEndIndex from './_trimmedEndIndex.js';\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nexport default baseTrim;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n","import baseTrim from './_baseTrim.js';\nimport isObject from './isObject.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nexport default toNumber;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nexport default identity;\n","import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n","import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n","import coreJsData from './_coreJsData.js';\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nexport default isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nexport default toSource;\n","import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nexport default baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nexport default getValue;\n","import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nexport default getNative;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nexport default WeakMap;\n","import isObject from './isObject.js';\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nexport default baseCreate;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nexport default apply;\n","/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nexport default noop;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nexport default copyArray;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nexport default shortOut;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nexport default constant;\n","import getNative from './_getNative.js';\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nexport default defineProperty;\n","import constant from './constant.js';\nimport defineProperty from './_defineProperty.js';\nimport identity from './identity.js';\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nexport default baseSetToString;\n","import baseSetToString from './_baseSetToString.js';\nimport shortOut from './_shortOut.js';\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nexport default setToString;\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nexport default arrayEach;\n","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nexport default baseFindIndex;\n","/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nexport default baseIsNaN;\n","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nexport default strictIndexOf;\n","import baseFindIndex from './_baseFindIndex.js';\nimport baseIsNaN from './_baseIsNaN.js';\nimport strictIndexOf from './_strictIndexOf.js';\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nexport default baseIndexOf;\n","import baseIndexOf from './_baseIndexOf.js';\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nexport default arrayIncludes;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nexport default isIndex;\n","import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nexport default baseAssignValue;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nexport default eq;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignValue;\n","import assignValue from './_assignValue.js';\nimport baseAssignValue from './_baseAssignValue.js';\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nexport default copyObject;\n","import apply from './_apply.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nexport default overRest;\n","import identity from './identity.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nexport default baseRest;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isLength;\n","import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nexport default isArrayLike;\n","import eq from './eq.js';\nimport isArrayLike from './isArrayLike.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nexport default isIterateeCall;\n","import baseRest from './_baseRest.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nexport default createAssigner;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nexport default isPrototype;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nexport default baseTimes;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nexport default baseIsArguments;\n","import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nexport default isArguments;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nexport default stubFalse;\n","import root from './_root.js';\nimport stubFalse from './stubFalse.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nexport default isBuffer;\n","import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nexport default baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nexport default baseUnary;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n","import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nexport default isTypedArray;\n","import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default arrayLikeKeys;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n","import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n","import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nexport default keys;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default nativeKeysIn;\n","import isObject from './isObject.js';\nimport isPrototype from './_isPrototype.js';\nimport nativeKeysIn from './_nativeKeysIn.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeysIn;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeysIn from './_baseKeysIn.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nexport default keysIn;\n","import isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nexport default isKey;\n","import getNative from './_getNative.js';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n","import nativeCreate from './_nativeCreate.js';\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nexport default hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default hashDelete;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nexport default hashGet;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nexport default hashHas;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nexport default hashSet;\n","import hashClear from './_hashClear.js';\nimport hashDelete from './_hashDelete.js';\nimport hashGet from './_hashGet.js';\nimport hashHas from './_hashHas.js';\nimport hashSet from './_hashSet.js';\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nexport default Hash;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nexport default listCacheClear;\n","import eq from './eq.js';\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nexport default assocIndexOf;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nexport default listCacheDelete;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nexport default listCacheGet;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nexport default listCacheHas;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nexport default listCacheSet;\n","import listCacheClear from './_listCacheClear.js';\nimport listCacheDelete from './_listCacheDelete.js';\nimport listCacheGet from './_listCacheGet.js';\nimport listCacheHas from './_listCacheHas.js';\nimport listCacheSet from './_listCacheSet.js';\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nexport default ListCache;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nexport default Map;\n","import Hash from './_Hash.js';\nimport ListCache from './_ListCache.js';\nimport Map from './_Map.js';\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nexport default mapCacheClear;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nexport default isKeyable;\n","import isKeyable from './_isKeyable.js';\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nexport default getMapData;\n","import getMapData from './_getMapData.js';\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default mapCacheDelete;\n","import getMapData from './_getMapData.js';\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nexport default mapCacheGet;\n","import getMapData from './_getMapData.js';\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nexport default mapCacheHas;\n","import getMapData from './_getMapData.js';\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nexport default mapCacheSet;\n","import mapCacheClear from './_mapCacheClear.js';\nimport mapCacheDelete from './_mapCacheDelete.js';\nimport mapCacheGet from './_mapCacheGet.js';\nimport mapCacheHas from './_mapCacheHas.js';\nimport mapCacheSet from './_mapCacheSet.js';\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nexport default MapCache;\n","import MapCache from './_MapCache.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\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 || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nexport default memoize;\n","import memoize from './memoize.js';\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nexport default memoizeCapped;\n","import memoizeCapped from './_memoizeCapped.js';\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nexport default stringToPath;\n","import baseToString from './_baseToString.js';\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nexport default toString;\n","import isArray from './isArray.js';\nimport isKey from './_isKey.js';\nimport stringToPath from './_stringToPath.js';\nimport toString from './toString.js';\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nexport default castPath;\n","import isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default toKey;\n","import castPath from './_castPath.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nexport default baseGet;\n","import baseGet from './_baseGet.js';\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nexport default get;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nexport default arrayPush;\n","import Symbol from './_Symbol.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nexport default isFlattenable;\n","import arrayPush from './_arrayPush.js';\nimport isFlattenable from './_isFlattenable.js';\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nexport default baseFlatten;\n","import baseFlatten from './_baseFlatten.js';\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nexport default flatten;\n","import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n","import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nexport default baseSlice;\n","import baseSlice from './_baseSlice.js';\n\n/**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\nfunction castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n}\n\nexport default castSlice;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsZWJ = '\\\\u200d';\n\n/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\nvar reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\nfunction hasUnicode(string) {\n return reHasUnicode.test(string);\n}\n\nexport default hasUnicode;\n","/**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction asciiToArray(string) {\n return string.split('');\n}\n\nexport default asciiToArray;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction unicodeToArray(string) {\n return string.match(reUnicode) || [];\n}\n\nexport default unicodeToArray;\n","import asciiToArray from './_asciiToArray.js';\nimport hasUnicode from './_hasUnicode.js';\nimport unicodeToArray from './_unicodeToArray.js';\n\n/**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n}\n\nexport default stringToArray;\n","import castSlice from './_castSlice.js';\nimport hasUnicode from './_hasUnicode.js';\nimport stringToArray from './_stringToArray.js';\nimport toString from './toString.js';\n\n/**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\nfunction createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n}\n\nexport default createCaseFirst;\n","import createCaseFirst from './_createCaseFirst.js';\n\n/**\n * Converts the first character of `string` to upper case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.upperFirst('fred');\n * // => 'Fred'\n *\n * _.upperFirst('FRED');\n * // => 'FRED'\n */\nvar upperFirst = createCaseFirst('toUpperCase');\n\nexport default upperFirst;\n","import toString from './toString.js';\nimport upperFirst from './upperFirst.js';\n\n/**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\nfunction capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n}\n\nexport default capitalize;\n","/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\nexport default arrayReduce;\n","/**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n}\n\nexport default basePropertyOf;\n","import basePropertyOf from './_basePropertyOf.js';\n\n/** Used to map Latin Unicode letters to basic Latin letters. */\nvar deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n};\n\n/**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\nvar deburrLetter = basePropertyOf(deburredLetters);\n\nexport default deburrLetter;\n","import deburrLetter from './_deburrLetter.js';\nimport toString from './toString.js';\n\n/** Used to match Latin Unicode letters (excluding mathematical operators). */\nvar reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n/** Used to compose unicode character classes. */\nvar rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;\n\n/** Used to compose unicode capture groups. */\nvar rsCombo = '[' + rsComboRange + ']';\n\n/**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\nvar reComboMark = RegExp(rsCombo, 'g');\n\n/**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\nfunction deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n}\n\nexport default deburr;\n","/** Used to match words composed of alphanumeric characters. */\nvar reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n/**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\nfunction asciiWords(string) {\n return string.match(reAsciiWord) || [];\n}\n\nexport default asciiWords;\n","/** Used to detect strings that need a more robust regexp to match words. */\nvar reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n/**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\nfunction hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n}\n\nexport default hasUnicodeWord;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n/** Used to compose unicode capture groups. */\nvar rsApos = \"['\\u2019]\",\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;\n\n/** Used to match complex or compound words. */\nvar reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n].join('|'), 'g');\n\n/**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\nfunction unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n}\n\nexport default unicodeWords;\n","import asciiWords from './_asciiWords.js';\nimport hasUnicodeWord from './_hasUnicodeWord.js';\nimport toString from './toString.js';\nimport unicodeWords from './_unicodeWords.js';\n\n/**\n * Splits `string` into an array of its words.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {RegExp|string} [pattern] The pattern to match words.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the words of `string`.\n * @example\n *\n * _.words('fred, barney, & pebbles');\n * // => ['fred', 'barney', 'pebbles']\n *\n * _.words('fred, barney, & pebbles', /[^, ]+/g);\n * // => ['fred', 'barney', '&', 'pebbles']\n */\nfunction words(string, pattern, guard) {\n string = toString(string);\n pattern = guard ? undefined : pattern;\n\n if (pattern === undefined) {\n return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);\n }\n return string.match(pattern) || [];\n}\n\nexport default words;\n","import arrayReduce from './_arrayReduce.js';\nimport deburr from './deburr.js';\nimport words from './words.js';\n\n/** Used to compose unicode capture groups. */\nvar rsApos = \"['\\u2019]\";\n\n/** Used to match apostrophes. */\nvar reApos = RegExp(rsApos, 'g');\n\n/**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\nfunction createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n}\n\nexport default createCompounder;\n","import capitalize from './capitalize.js';\nimport createCompounder from './_createCompounder.js';\n\n/**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\nvar camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n});\n\nexport default camelCase;\n","/**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\nfunction baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n}\n\nexport default baseClamp;\n","import baseClamp from './_baseClamp.js';\nimport toNumber from './toNumber.js';\n\n/**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\nfunction clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n}\n\nexport default clamp;\n","import ListCache from './_ListCache.js';\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nexport default stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nexport default stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nexport default stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nexport default stackHas;\n","import ListCache from './_ListCache.js';\nimport Map from './_Map.js';\nimport MapCache from './_MapCache.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nexport default stackSet;\n","import ListCache from './_ListCache.js';\nimport stackClear from './_stackClear.js';\nimport stackDelete from './_stackDelete.js';\nimport stackGet from './_stackGet.js';\nimport stackHas from './_stackHas.js';\nimport stackSet from './_stackSet.js';\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nexport default Stack;\n","import copyObject from './_copyObject.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nexport default baseAssign;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nexport default baseAssignIn;\n","import root from './_root.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nexport default cloneBuffer;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nexport default arrayFilter;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nexport default stubArray;\n","import arrayFilter from './_arrayFilter.js';\nimport stubArray from './stubArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nexport default getSymbols;\n","import copyObject from './_copyObject.js';\nimport getSymbols from './_getSymbols.js';\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nexport default copySymbols;\n","import arrayPush from './_arrayPush.js';\nimport getPrototype from './_getPrototype.js';\nimport getSymbols from './_getSymbols.js';\nimport stubArray from './stubArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nexport default getSymbolsIn;\n","import copyObject from './_copyObject.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nexport default copySymbolsIn;\n","import arrayPush from './_arrayPush.js';\nimport isArray from './isArray.js';\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nexport default baseGetAllKeys;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbols from './_getSymbols.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nexport default getAllKeys;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nexport default getAllKeysIn;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nexport default DataView;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nexport default Promise;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nexport default Set;\n","import DataView from './_DataView.js';\nimport Map from './_Map.js';\nimport Promise from './_Promise.js';\nimport Set from './_Set.js';\nimport WeakMap from './_WeakMap.js';\nimport baseGetTag from './_baseGetTag.js';\nimport toSource from './_toSource.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nexport default getTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nexport default initCloneArray;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nexport default Uint8Array;\n","import Uint8Array from './_Uint8Array.js';\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nexport default cloneArrayBuffer;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nexport default cloneDataView;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nexport default cloneRegExp;\n","import Symbol from './_Symbol.js';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nexport default cloneSymbol;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nexport default cloneTypedArray;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\nimport cloneDataView from './_cloneDataView.js';\nimport cloneRegExp from './_cloneRegExp.js';\nimport cloneSymbol from './_cloneSymbol.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nexport default initCloneByTag;\n","import baseCreate from './_baseCreate.js';\nimport getPrototype from './_getPrototype.js';\nimport isPrototype from './_isPrototype.js';\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nexport default initCloneObject;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nexport default baseIsMap;\n","import baseIsMap from './_baseIsMap.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nexport default isMap;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nexport default baseIsSet;\n","import baseIsSet from './_baseIsSet.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nexport default isSet;\n","import Stack from './_Stack.js';\nimport arrayEach from './_arrayEach.js';\nimport assignValue from './_assignValue.js';\nimport baseAssign from './_baseAssign.js';\nimport baseAssignIn from './_baseAssignIn.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport copyArray from './_copyArray.js';\nimport copySymbols from './_copySymbols.js';\nimport copySymbolsIn from './_copySymbolsIn.js';\nimport getAllKeys from './_getAllKeys.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\nimport getTag from './_getTag.js';\nimport initCloneArray from './_initCloneArray.js';\nimport initCloneByTag from './_initCloneByTag.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isMap from './isMap.js';\nimport isObject from './isObject.js';\nimport isSet from './isSet.js';\nimport keys from './keys.js';\nimport keysIn from './keysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nexport default baseClone;\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nexport default setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nexport default setCacheHas;\n","import MapCache from './_MapCache.js';\nimport setCacheAdd from './_setCacheAdd.js';\nimport setCacheHas from './_setCacheHas.js';\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nexport default SetCache;\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nexport default arraySome;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nexport default cacheHas;\n","import SetCache from './_SetCache.js';\nimport arraySome from './_arraySome.js';\nimport cacheHas from './_cacheHas.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nexport default equalArrays;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nexport default mapToArray;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nexport default setToArray;\n","import Symbol from './_Symbol.js';\nimport Uint8Array from './_Uint8Array.js';\nimport eq from './eq.js';\nimport equalArrays from './_equalArrays.js';\nimport mapToArray from './_mapToArray.js';\nimport setToArray from './_setToArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nexport default equalByTag;\n","import getAllKeys from './_getAllKeys.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nexport default equalObjects;\n","import Stack from './_Stack.js';\nimport equalArrays from './_equalArrays.js';\nimport equalByTag from './_equalByTag.js';\nimport equalObjects from './_equalObjects.js';\nimport getTag from './_getTag.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nexport default baseIsEqualDeep;\n","import baseIsEqualDeep from './_baseIsEqualDeep.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nexport default baseIsEqual;\n","import Stack from './_Stack.js';\nimport baseIsEqual from './_baseIsEqual.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nexport default baseIsMatch;\n","import isObject from './isObject.js';\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nexport default isStrictComparable;\n","import isStrictComparable from './_isStrictComparable.js';\nimport keys from './keys.js';\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nexport default getMatchData;\n","/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nexport default matchesStrictComparable;\n","import baseIsMatch from './_baseIsMatch.js';\nimport getMatchData from './_getMatchData.js';\nimport matchesStrictComparable from './_matchesStrictComparable.js';\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nexport default baseMatches;\n","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nexport default baseHasIn;\n","import castPath from './_castPath.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isIndex from './_isIndex.js';\nimport isLength from './isLength.js';\nimport toKey from './_toKey.js';\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nexport default hasPath;\n","import baseHasIn from './_baseHasIn.js';\nimport hasPath from './_hasPath.js';\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\nexport default hasIn;\n","import baseIsEqual from './_baseIsEqual.js';\nimport get from './get.js';\nimport hasIn from './hasIn.js';\nimport isKey from './_isKey.js';\nimport isStrictComparable from './_isStrictComparable.js';\nimport matchesStrictComparable from './_matchesStrictComparable.js';\nimport toKey from './_toKey.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nexport default baseMatchesProperty;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nexport default baseProperty;\n","import baseGet from './_baseGet.js';\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nexport default basePropertyDeep;\n","import baseProperty from './_baseProperty.js';\nimport basePropertyDeep from './_basePropertyDeep.js';\nimport isKey from './_isKey.js';\nimport toKey from './_toKey.js';\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nexport default property;\n","import baseMatches from './_baseMatches.js';\nimport baseMatchesProperty from './_baseMatchesProperty.js';\nimport identity from './identity.js';\nimport isArray from './isArray.js';\nimport property from './property.js';\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\nexport default baseIteratee;\n","/**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n}\n\nexport default arrayAggregator;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nexport default createBaseFor;\n","import createBaseFor from './_createBaseFor.js';\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nexport default baseFor;\n","import baseFor from './_baseFor.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nexport default baseForOwn;\n","import isArrayLike from './isArrayLike.js';\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nexport default createBaseEach;\n","import baseForOwn from './_baseForOwn.js';\nimport createBaseEach from './_createBaseEach.js';\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nexport default baseEach;\n","import baseEach from './_baseEach.js';\n\n/**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n}\n\nexport default baseAggregator;\n","import arrayAggregator from './_arrayAggregator.js';\nimport baseAggregator from './_baseAggregator.js';\nimport baseIteratee from './_baseIteratee.js';\nimport isArray from './isArray.js';\n\n/**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\nfunction createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, baseIteratee(iteratee, 2), accumulator);\n };\n}\n\nexport default createAggregator;\n","import root from './_root.js';\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nexport default now;\n","import isObject from './isObject.js';\nimport now from './now.js';\nimport toNumber from './toNumber.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nexport default debounce;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignMergeValue;\n","import isArrayLike from './isArrayLike.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nexport default isArrayLikeObject;\n","/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nexport default safeGet;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nexport default toPlainObject;\n","import assignMergeValue from './_assignMergeValue.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\nimport copyArray from './_copyArray.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport isBuffer from './isBuffer.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport isPlainObject from './isPlainObject.js';\nimport isTypedArray from './isTypedArray.js';\nimport safeGet from './_safeGet.js';\nimport toPlainObject from './toPlainObject.js';\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nexport default baseMergeDeep;\n","import Stack from './_Stack.js';\nimport assignMergeValue from './_assignMergeValue.js';\nimport baseFor from './_baseFor.js';\nimport baseMergeDeep from './_baseMergeDeep.js';\nimport isObject from './isObject.js';\nimport keysIn from './keysIn.js';\nimport safeGet from './_safeGet.js';\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nexport default baseMerge;\n","/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\nexport default arrayIncludesWith;\n","/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n}\n\nexport default last;\n","import baseEach from './_baseEach.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n}\n\nexport default baseMap;\n","import arrayMap from './_arrayMap.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseMap from './_baseMap.js';\nimport isArray from './isArray.js';\n\n/**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\nfunction map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, baseIteratee(iteratee, 3));\n}\n\nexport default map;\n","import baseFlatten from './_baseFlatten.js';\nimport map from './map.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\nfunction flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n}\n\nexport default flatMapDeep;\n","/**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\nfunction fromPairs(pairs) {\n var index = -1,\n length = pairs == null ? 0 : pairs.length,\n result = {};\n\n while (++index < length) {\n var pair = pairs[index];\n result[pair[0]] = pair[1];\n }\n return result;\n}\n\nexport default fromPairs;\n","import baseAssignValue from './_baseAssignValue.js';\nimport createAggregator from './_createAggregator.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\nvar groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n});\n\nexport default groupBy;\n","import baseKeys from './_baseKeys.js';\nimport getTag from './_getTag.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLike from './isArrayLike.js';\nimport isBuffer from './isBuffer.js';\nimport isPrototype from './_isPrototype.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\nfunction isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n}\n\nexport default isEmpty;\n","import baseIsEqual from './_baseIsEqual.js';\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nexport default isEqual;\n","import createCompounder from './_createCompounder.js';\n\n/**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\nvar kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n});\n\nexport default kebabCase;\n","import baseMerge from './_baseMerge.js';\nimport createAssigner from './_createAssigner.js';\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\nexport default merge;\n","import baseEach from './_baseEach.js';\n\n/**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n}\n\nexport default baseSome;\n","import arraySome from './_arraySome.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseSome from './_baseSome.js';\nimport isArray from './isArray.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\nfunction some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, baseIteratee(predicate, 3));\n}\n\nexport default some;\n","import Set from './_Set.js';\nimport noop from './noop.js';\nimport setToArray from './_setToArray.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\nexport default createSet;\n","import SetCache from './_SetCache.js';\nimport arrayIncludes from './_arrayIncludes.js';\nimport arrayIncludesWith from './_arrayIncludesWith.js';\nimport cacheHas from './_cacheHas.js';\nimport createSet from './_createSet.js';\nimport setToArray from './_setToArray.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nexport default baseUniq;\n","import baseFlatten from './_baseFlatten.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseRest from './_baseRest.js';\nimport baseUniq from './_baseUniq.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport last from './last.js';\n\n/**\n * This method is like `_.union` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which uniqueness is computed. Result values are chosen from the first\n * array in which the value occurs. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.unionBy([2.1], [1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\nvar unionBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), baseIteratee(iteratee, 2));\n});\n\nexport default unionBy;\n","import baseUniq from './_baseUniq.js';\n\n/**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\nfunction uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n}\n\nexport default uniq;\n","/**\n * enum of all events related to the chart on the DOM\n */\nexport enum Chart {\n\tRENDER_FINISHED = 'render-finished',\n\tRESIZE = 'chart-resize',\n\tMOUSEOVER = 'chart-mouseover',\n\t// MOUSEMOVE = \"chart-mousemove\",\n\t// CLICK = \"chart-click\",\n\tMOUSEOUT = 'chart-mouseout'\n}\n/**\n * enum of all events related to the overlay modal\n */\nexport enum Modal {\n\tSHOW = 'show-modal',\n\tHIDE = 'hide-modal'\n}\n\n/**\n * enum of all events related to the chart model\n */\nexport enum Model {\n\tUPDATE = 'model-update'\n}\n\n/**\n * enum of all toolbar events\n */\nexport enum Toolbar {\n\tSHOW_OVERFLOW_MENU = 'show-toolbar-overflow-menu',\n\tHIDE_OVERFLOW_MENU = 'hide-toolbar-overflow-menu',\n\tBUTTON_CLICK = 'toolbar-button-click'\n}\n\n/**\n * enum of all events related to the zoom-bar\n */\nexport enum ZoomBar {\n\tUPDATE = 'zoom-bar-update',\n\tSELECTION_START = 'zoom-bar-selection-start',\n\tSELECTION_IN_PROGRESS = 'zoom-bar-selection-in-progress',\n\tSELECTION_END = 'zoom-bar-selection-end'\n}\n\n/**\n * enum of all events related to the zoom domain\n */\nexport enum ZoomDomain {\n\tCHANGE = 'zoom-domain-change'\n}\n\n/** enum of all events related to canvas zoom *\n *\n */\nexport enum CanvasZoom {\n\tCANVAS_ZOOM_IN = 'canvas-zoom-in',\n\tCANVAS_ZOOM_OUT = 'canvas-zoom-out'\n}\n\n/**\n * enum of all axis-related events\n */\nexport enum Axis {\n\tLABEL_MOUSEOVER = 'axis-label-mouseover',\n\tLABEL_MOUSEMOVE = 'axis-label-mousemove',\n\tLABEL_CLICK = 'axis-label-click',\n\tLABEL_MOUSEOUT = 'axis-label-mouseout',\n\tLABEL_FOCUS = 'axis-label-focus',\n\tLABEL_BLUR = 'axis-label-blur',\n\tRENDER_COMPLETE = 'axis-render-complete'\n}\n\n/**\n * enum of all area graph events\n */\nexport enum Area {\n\tPOINT_MOUSEOVER = 'scatter-mouseover',\n\tPOINT_MOUSEMOVE = 'scatter-mousemove',\n\tPOINT_CLICK = 'scatter-click',\n\tPOINT_MOUSEOUT = 'scatter-mouseout'\n}\n\n/**\n * enum of all wordcloud graph events\n */\nexport enum WordCloud {\n\tWORD_MOUSEOVER = 'wordcloud-word-mouseover',\n\tWORD_MOUSEMOVE = 'wordcloud-word-mousemove',\n\tWORD_CLICK = 'wordcloud-word-click',\n\tWORD_MOUSEOUT = 'wordcloud-word-mouseout'\n}\n\n/**\n * enum of all pie graph events\n */\nexport enum Pie {\n\tSLICE_MOUSEOVER = 'pie-slice-mouseover',\n\tSLICE_MOUSEMOVE = 'pie-slice-mousemove',\n\tSLICE_CLICK = 'pie-slice-click',\n\tSLICE_MOUSEOUT = 'pie-slice-mouseout'\n}\n\n/**\n * enum of all gauge graph events\n */\nexport enum Gauge {\n\tARC_MOUSEOVER = 'gauge-arc-mouseover',\n\tARC_MOUSEMOVE = 'gauge-arc-mousemove',\n\tARC_CLICK = 'gauge-arc-click',\n\tARC_MOUSEOUT = 'gauge-arc-mouseout'\n}\n\n/**\n * enum of all bar graph events\n */\nexport enum Bar {\n\tBAR_MOUSEOVER = 'bar-mouseover',\n\tBAR_MOUSEMOVE = 'bar-mousemove',\n\tBAR_CLICK = 'bar-click',\n\tBAR_MOUSEOUT = 'bar-mouseout'\n}\n\n/**\n * enum of all boxplot graph events\n */\nexport enum Boxplot {\n\tBOX_MOUSEOVER = 'box-mouseover',\n\tBOX_MOUSEMOVE = 'box-mousemove',\n\tBOX_CLICK = 'box-click',\n\tBOX_MOUSEOUT = 'box-mouseout',\n\tOUTLIER_MOUSEOVER = 'outlier-mouseover',\n\tOUTLIER_MOUSEMOVE = 'outlier-mousemove',\n\tOUTLIER_CLICK = 'outlier-click',\n\tOUTLIER_MOUSEOUT = 'outlier-mouseout'\n}\n\n/**\n * enum of all scatter graph events\n */\nexport enum Scatter {\n\tSCATTER_MOUSEOVER = 'scatter-mouseover',\n\tSCATTER_MOUSEMOVE = 'scatter-mousemove',\n\tSCATTER_CLICK = 'scatter-click',\n\tSCATTER_MOUSEOUT = 'scatter-mouseout'\n}\n\n/**\n * enum of all line graph events\n */\nexport enum Line {\n\tPOINT_MOUSEOVER = 'scatter-mouseover',\n\tPOINT_MOUSEMOVE = 'scatter-mousemove',\n\tPOINT_CLICK = 'scatter-click',\n\tPOINT_MOUSEOUT = 'scatter-mouseout'\n}\n\n/**\n * enum of all radar graph events\n */\nexport enum Radar {\n\tX_AXIS_MOUSEOVER = 'radar-x-axis-mouseover',\n\tX_AXIS_MOUSEMOVE = 'radar-x-axis-mousemove',\n\tX_AXIS_CLICK = 'radar-x-axis-click',\n\tX_AXIS_MOUSEOUT = 'radar-x-axis-mouseout'\n}\n\n/**\n * enum of all tree graph events\n */\nexport enum Tree {\n\tNODE_MOUSEOVER = 'tree-node-mouseover',\n\tNODE_CLICK = 'tree-node-click',\n\tNODE_MOUSEOUT = 'tree-node-mouseout'\n}\n\n/**\n * enum of all treemap graph events\n */\nexport enum Treemap {\n\tLEAF_MOUSEOVER = 'leaf-mouseover',\n\tLEAF_MOUSEMOVE = 'leaf-mousemove',\n\tLEAF_CLICK = 'leaf-click',\n\tLEAF_MOUSEOUT = 'leaf-mouseout'\n}\n\n/**\n * enum of all tooltip events\n */\nexport enum Tooltip {\n\tSHOW = 'show-tooltip',\n\tMOVE = 'move-tooltip',\n\tHIDE = 'hide-tooltip'\n}\n\n/**\n * enum of all threshold events\n */\nexport enum Threshold {\n\tSHOW = 'show-threshold',\n\tHIDE = 'hide-threshold'\n}\n\n/**\n * enum of all legend related events\n */\nexport enum Legend {\n\tITEM_HOVER = 'legend-item-onhover',\n\tITEM_CLICK = 'legend-item-onclick',\n\tITEM_MOUSEOUT = 'legend-item-onmouseout',\n\tITEMS_UPDATE = 'legend-items-update'\n}\n\n/**\n * enum of all circlepack related events\n */\nexport enum CirclePack {\n\tCIRCLE_MOUSEOVER = 'circle-leaf-mouseover',\n\tCIRCLE_CLICK = 'circle-leaf-click',\n\tCIRCLE_MOUSEOUT = 'circle-leaf-mouseout',\n\tCIRCLE_MOUSEMOVE = 'circle-leaf-mousemove'\n}\n\n/**\n * enum of all alluvial related events\n */\nexport enum Alluvial {\n\tNODE_MOUSEOVER = 'alluvial-node-mouseover',\n\tNODE_CLICK = 'alluvial-node-click',\n\tNODE_MOUSEOUT = 'alluvial-node-mouseout',\n\tNODE_MOUSEMOVE = 'alluvial-node-mousemove',\n\tLINE_MOUSEOVER = 'alluvial-line-mouseover',\n\tLINE_CLICK = 'alluvial-line-click',\n\tLINE_MOUSEOUT = 'alluvial-line-mouseout',\n\tLINE_MOUSEMOVE = 'alluvial-line-mousemove'\n}\n\n/**\n * enum of all meter related events\n */\nexport enum Meter {\n\tMETER_MOUSEOVER = 'meter-mouseover',\n\tMETER_CLICK = 'meter-click',\n\tMETER_MOUSEOUT = 'meter-mouseout',\n\tMETER_MOUSEMOVE = 'meter-mousemove'\n}\n\n/**\n * enum of all heatmap related events\n */\nexport enum Heatmap {\n\tHEATMAP_MOUSEOVER = 'heatmap-mouseover',\n\tHEATMAP_CLICK = 'heatmap-click',\n\tHEATMAP_MOUSEOUT = 'heatmap-mouseout',\n\tHEATMAP_MOUSEMOVE = 'hetmap-mousemove'\n}\n\n/**\n * enum of all choropleth related events\n */\nexport enum Choropleth {\n\tCHOROPLETH_MOUSEOVER = 'choropleth-mouseover',\n\tCHOROPLETH_CLICK = 'choropleth-click',\n\tCHOROPLETH_MOUSEOUT = 'choropleth-mouseout',\n\tCHOROPLETH_MOUSEMOVE = 'choropleth-mousemove'\n}\n","import * as EventEnums from './events'\nexport const Events = EventEnums\n\nexport enum RenderTypes {\n\tHTML = 'html',\n\tSVG = 'svg'\n}\n\n/**\n * enum of all supported chart themes\n */\nexport enum ChartTheme {\n\tWHITE = 'white',\n\tG100 = 'g100',\n\tG90 = 'g90',\n\tG10 = 'g10'\n}\n\n/**\n * enum of all color classname types\n */\nexport enum ColorClassNameTypes {\n\tBACKGROUND = 'background',\n\tFILL = 'fill',\n\tSTROKE = 'stroke',\n\tTOOLTIP = 'tooltip'\n}\n\n/**\n * enum of all possible axis positions\n */\nexport enum AxisPositions {\n\tLEFT = 'left',\n\tRIGHT = 'right',\n\tTOP = 'top',\n\tBOTTOM = 'bottom'\n}\n\n/**\n * enum of all possible axis positions\n */\nexport enum ZoomBarTypes {\n\tGRAPH_VIEW = 'graph_view',\n\tSLIDER_VIEW = 'slider_view'\n}\n\n/**\n * enum of all possible truncation types\n */\nexport enum TruncationTypes {\n\tEND_LINE = 'end_line',\n\tMID_LINE = 'mid_line',\n\tFRONT_LINE = 'front_line',\n\tNONE = 'none'\n}\n\n/**\n * enum of all possible cartesian orientations\n * to be used for determining the orientation\n * of graphs being draw over\n * cartesian scales\n */\nexport enum CartesianOrientations {\n\tVERTICAL = 'vertical',\n\tHORIZONTAL = 'horizontal'\n}\n\n/**\n * enum of all possible scale types\n */\nexport enum ScaleTypes {\n\tTIME = 'time',\n\tLINEAR = 'linear',\n\tLOG = 'log',\n\tLABELS = 'labels',\n\tLABELS_RATIO = 'labels-ratio'\n}\n\n/**\n * enum of all possible legend positions\n */\nexport enum LegendPositions {\n\tRIGHT = 'right',\n\tLEFT = 'left',\n\tTOP = 'top',\n\tBOTTOM = 'bottom'\n}\n\n/**\n * enum of all possible alignments\n */\nexport enum Alignments {\n\tLEFT = 'left',\n\tCENTER = 'center',\n\tRIGHT = 'right'\n}\n\n/**\n * enum of all possible legend orientations\n */\nexport enum LegendOrientations {\n\tHORIZONTAL = 'horizontal',\n\tVERTICAL = 'vertical'\n}\n\n/**\n * enum of tree types for the tree chart\n */\nexport enum TreeTypes {\n\tTREE = 'tree',\n\tDENDROGRAM = 'dendrogram'\n}\n\n/**\n * enum of all possible layout directions\n */\nexport enum LayoutDirection {\n\tROW = 'row',\n\tCOLUMN = 'column',\n\tROW_REVERSE = 'row-reverse',\n\tCOLUMN_REVERSE = 'column-reverse'\n}\n\n/**\n * enum of all possible layout growth values\n */\nexport enum LayoutGrowth {\n\tFIXED = 'fixed',\n\tPREFERRED = 'preferred',\n\tSTRETCH = 'stretch'\n}\n\n/**\n * enum of all possible layout align-items values\n */\nexport enum LayoutAlignItems {\n\tCENTER = 'center'\n}\n\n/**\n * enum of all possible callout directions\n */\nexport enum CalloutDirections {\n\tLEFT = 'left',\n\tRIGHT = 'right'\n}\n\n/**\n * enum of all possible skeleton/empty state types\n */\nexport enum Skeletons {\n\tGRID = 'grid',\n\tVERT_OR_HORIZ = 'vertOrHoriz',\n\tPIE = 'pie',\n\tDONUT = 'donut'\n}\n\n/**\n * enum of all possible attributes used to aling text horizontally\n */\nexport enum TextAnchor {\n\tSTART = 'start',\n\tMIDDLE = 'middle',\n\tEND = 'end'\n}\n\n/**\n * enum of all possible attributes used to aling text vertically\n */\nexport enum DominantBaseline {\n\tBASELINE = 'baseline',\n\tMIDDLE = 'middle',\n\tHANGING = 'hanging'\n}\n\nexport enum GaugeTypes {\n\tSEMI = 'semi',\n\tFULL = 'full'\n}\n\n/**\n * enum of all possible callout directions\n */\nexport enum ArrowDirections {\n\tUP = 'up',\n\tDOWN = 'down'\n}\n\n/**\n * enum of carbon statuses\n */\nexport enum Statuses {\n\tSUCCESS = 'success',\n\tWARNING = 'warning',\n\tDANGER = 'danger'\n}\n\n/**\n * enum of axis ticks rotation\n */\nexport enum TickRotations {\n\tALWAYS = 'always',\n\tAUTO = 'auto',\n\tNEVER = 'never'\n}\n\n/**\n * enum of chartTypes that work with combo chart\n */\nexport enum ChartTypes {\n\tSCATTER = 'scatter',\n\tLINE = 'line',\n\tSIMPLE_BAR = 'simple-bar',\n\tSTACKED_BAR = 'stacked-bar',\n\tGROUPED_BAR = 'grouped-bar',\n\tAREA = 'area',\n\tSTACKED_AREA = 'stacked-area'\n}\n\n/**\n * enum of supported toolbar control types\n */\nexport enum ToolbarControlTypes {\n\tEXPORT_CSV = 'Export as CSV',\n\tEXPORT_PNG = 'Export as PNG',\n\tEXPORT_JPG = 'Export as JPG',\n\tZOOM_IN = 'Zoom in',\n\tZOOM_OUT = 'Zoom out',\n\tRESET_ZOOM = 'Reset zoom',\n\tMAKE_FULLSCREEN = 'Make fullscreen',\n\tSHOW_AS_DATATABLE = 'Show as data-table',\n\tCUSTOM = 'Custom'\n}\n\n/**\n * enum of title orientations for _vertical axes_\n */\nexport enum AxisTitleOrientations {\n\tLEFT = 'left',\n\tRIGHT = 'right'\n}\n\n/**\n * enum of legend item type\n */\nexport enum LegendItemType {\n\tCHECKBOX = 'checkbox',\n\tRADIUS = 'radius',\n\tAREA = 'area',\n\tSIZE = 'size',\n\tLINE = 'line',\n\tQUARTILE = 'quartile',\n\tZOOM = 'zoom'\n}\n\n/**\n * enum of color legend types\n */\nexport enum ColorLegendType {\n\tLINEAR = 'linear',\n\tQUANTIZE = 'quantize'\n}\n\n/**\n * enum of divider status for heatmap\n */\nexport enum DividerStatus {\n\tON = 'on',\n\tAUTO = 'auto',\n\tOFF = 'off'\n}\n\n/**\n * enum of axis flavor\n */\nexport enum AxisFlavor {\n\tDEFAULT = 'default',\n\tHOVERABLE = 'hoverable'\n}\n\n/**\n * enum of supported projection types\n */\nexport enum Projection {\n\t// Azimuthal Projections\n\tgeoEqualEarth = 'geoEqualEarth',\n\n\t// Conic projections\n\tgeoAlbers = 'geoAlbers',\n\tgeoConicEqualArea = 'geoConicEqualArea',\n\tgeoConicEquidistant = 'geoConicEquidistant',\n\n\t// Cylindrical projections\n\tgeoEquirectangular = 'geoEquirectangular',\n\tgeoMercator = 'geoMercator',\n\tgeoNaturalEarth1 = 'geoNaturalEarth1'\n}\n","import { easeCubicInOut } from 'd3'\nimport { LegendItemType, ZoomBarTypes } from '@/interfaces/enums'\n\nexport const carbonPrefix = 'cds' as string\n\nexport const area = {\n\topacity: {\n\t\tunselected: 0.05,\n\t\tselected: 0.4\n\t}\n}\n\nexport const axis = {\n\tticks: {\n\t\tnumber: 7,\n\t\trotateIfSmallerThan: 30,\n\t\tverticalSpaceRatio: 2.5,\n\t\thorizontalSpaceRatio: 3.5\n\t},\n\tratio: {\n\t\treference: 'value',\n\t\tcompareTo: 'marker'\n\t},\n\tpaddingRatio: 0.1,\n\thover: {\n\t\trectanglePadding: 4\n\t}\n}\n\nexport const canvasZoomSettings = {\n\tduration: 1000,\n\tease: easeCubicInOut,\n\tzoomLevel: 3\n}\n\nexport const circlePack = {\n\tcircles: {\n\t\tfillOpacity: 0.3,\n\t\thover: {\n\t\t\tstroke: '#FFF'\n\t\t}\n\t},\n\tpadding: {\n\t\tmainGroup: 4,\n\t\tchildren: 2\n\t},\n\thierarchyLevel: 2\n}\n\nexport const color = {\n\tpairingOptions: {\n\t\t'1-color': 4,\n\t\t'2-color': 5,\n\t\t'3-color': 5,\n\t\t'4-color': 3,\n\t\t'5-color': 2,\n\t\t'14-color': 1\n\t}\n}\n\nexport const boxplot = {\n\tcircle: {\n\t\tradius: 4,\n\t\topacity: {\n\t\t\thovered: 1,\n\t\t\tdefault: 0.3\n\t\t}\n\t},\n\tbox: {\n\t\topacity: {\n\t\t\thovered: 0.5,\n\t\t\tdefault: 0.3\n\t\t}\n\t},\n\tstrokeWidth: {\n\t\tdefault: 1,\n\t\tthicker: 2\n\t}\n}\n\nexport const histogram = {\n\tdefaultBins: 10\n}\n\nexport const legend = {\n\titems: {\n\t\tstatus: {\n\t\t\tACTIVE: 1,\n\t\t\tDISABLED: 0\n\t\t},\n\t\thorizontalSpace: 12,\n\t\tverticalSpace: 24,\n\t\ttextYOffset: 8,\n\t\tspaceAfter: 4\n\t},\n\tcheckbox: {\n\t\tradius: 6.5\n\t},\n\tradius: {\n\t\ticonData: [\n\t\t\t{ cx: 7, cy: 7, r: 6.5 },\n\t\t\t{ cx: 7, cy: 10, r: 3.5 }\n\t\t],\n\t\tfill: null as any,\n\t\tstroke: '#8c8c8c'\n\t},\n\tline: {\n\t\tyPosition: 6,\n\t\twidth: 24,\n\t\tstrokeWidth: 1.4,\n\t\tfill: null as any,\n\t\tstroke: '#999999'\n\t},\n\tarea: {\n\t\twidth: 24,\n\t\theight: 14,\n\t\tfill: '#6f6f6f',\n\t\tstroke: null as any\n\t},\n\tsize: {\n\t\ticonData: [\n\t\t\t{ width: 23, height: 12 },\n\t\t\t{ width: 13, height: 6 }\n\t\t],\n\t\tfill: null as any,\n\t\tstroke: '#8D8D8D'\n\t},\n\tquartile: {\n\t\ticonData: [\n\t\t\t{ x: 0, y: 0, width: 24, height: 13 },\n\t\t\t{ x: 11, y: 4, width: 1, height: 4 }\n\t\t]\n\t},\n\tzoom: {\n\t\ticonData: [{ x: 0, y: 0, width: 12, height: 12 }],\n\t\tcolor: '#8D8D8D'\n\t},\n\tcolor: {\n\t\tbarWidth: 300,\n\t\tbarHeight: 8,\n\t\taxisYTranslation: 10\n\t}\n}\n\nexport const lines = {\n\topacity: {\n\t\tunselected: 0.3,\n\t\tselected: 1\n\t},\n\tweight: {\n\t\tselected: 2,\n\t\tunselected: 1\n\t}\n}\n\nexport const meter = {\n\tstatusBar: {\n\t\tpaddingRight: 5\n\t},\n\tstatus: {\n\t\tindicatorSize: 16,\n\t\tpaddingLeft: 15\n\t},\n\ttotal: {\n\t\tpaddingLeft: 36,\n\t\tpaddingRight: 24\n\t},\n\theight: {\n\t\tdefault: 8,\n\t\tproportional: 16\n\t},\n\tdividerWidth: 2\n}\n\nexport const pie = {\n\tradiusOffset: -15,\n\tinnerRadius: 2,\n\tpadAngle: 0.007,\n\thoverArc: {\n\t\touterRadiusOffset: 3\n\t},\n\txOffset: 30,\n\tyOffset: 20,\n\tyOffsetCallout: 10,\n\tcallout: {\n\t\tminSliceDegree: 5,\n\t\toffsetX: 15,\n\t\toffsetY: 12,\n\t\thorizontalLineLength: 8,\n\t\ttextMargin: 2\n\t}\n}\n\nexport const radar = {\n\topacity: {\n\t\tunselected: 0.1,\n\t\tselected: 0.3\n\t},\n\txLabelPadding: 10,\n\tyLabelPadding: 8,\n\tyTicksNumber: 4,\n\tminRange: 10,\n\txAxisRectHeight: 50,\n\tdotsRadius: 5\n}\n\nexport const alluvial = {\n\tnodeWidth: 4,\n\tnodeHoveredWidth: 8,\n\tminNodePadding: 24,\n\topacity: {\n\t\tunfocus: 0.3,\n\t\tdefault: 0.8,\n\t\tselected: 1\n\t}\n}\n\nexport const heatmap = {\n\tminCellDividerDimension: 16,\n\t// Ensures axes lines are displayed with or without stroke disabled\n\tchartPadding: 0.5\n}\n\nexport const spacers = {\n\tdefault: {\n\t\tsize: 24\n\t}\n}\n\nexport const tooltips = {\n\thorizontalOffset: 10\n}\n\n/**\n * Base transition configuration\n */\nexport const transitions = {\n\tdefault: {\n\t\tduration: 300\n\t},\n\tpie_slice_mouseover: {\n\t\tduration: 100\n\t},\n\tpie_chart_titles: {\n\t\tduration: 375\n\t},\n\tgraph_element_mouseover_fill_update: {\n\t\tduration: 100\n\t},\n\tgraph_element_mouseout_fill_update: {\n\t\tduration: 100\n\t}\n}\n\nexport const toolbar = {\n\tbuttonSize: 32,\n\ticonSize: 20,\n\theight: 32,\n\tspacerHeight: 10,\n\ticonPadding: 6\n}\n\nexport const zoomBar = {\n\theight: {\n\t\t[ZoomBarTypes.GRAPH_VIEW]: 32,\n\t\t[ZoomBarTypes.SLIDER_VIEW]: 10\n\t},\n\tspacerHeight: 8,\n\thandleWidth: 5,\n\thandleBarWidth: 1,\n\thandleBarHeight: 12\n}\n\nexport const defaultLegendAdditionalItems = [\n\t{\n\t\ttype: LegendItemType.RADIUS,\n\t\tname: 'Radius'\n\t},\n\t{\n\t\ttype: LegendItemType.AREA,\n\t\tname: 'Poor area'\n\t},\n\t{\n\t\ttype: LegendItemType.AREA,\n\t\tname: 'Satisfactory area'\n\t},\n\t{\n\t\ttype: LegendItemType.AREA,\n\t\tname: 'Great area'\n\t},\n\t{\n\t\ttype: LegendItemType.QUARTILE,\n\t\tname: 'Quartiles'\n\t}\n]\n","import { pointer, type Numeric } from 'd3'\nimport { merge, cloneDeep, unionBy } from 'lodash-es'\nimport { CartesianOrientations, ScaleTypes, TruncationTypes } from '@/interfaces/enums'\nimport { defaultLegendAdditionalItems } from './configuration-non-customizable'\n\nexport function debounceWithD3MousePosition(fn: any, delay: number, holder: any) {\n\tlet timer: any = null\n\treturn function (...args: any) {\n\t\tconst context = this\n\n\t\t// Get D3 event here\n\t\tcontext.mousePosition = pointer(args[0], holder)\n\n\t\tclearTimeout(timer)\n\n\t\ttimer = setTimeout(function () {\n\t\t\t// and use reference here\n\t\t\tfn.apply(context, args)\n\t\t}, delay)\n\t}\n}\n\n/**\n * Returns default chart options merged with provided options,\n * with special cases for axes.\n * Axes object will not merge the not provided axes.\n *\n * @export\n * @param {AxisChartOptions} defaultOptions Configuration.options[chartType]\n * @param {AxisChartOptions} providedOptions user provided options\n * @returns merged options\n */\nexport function mergeDefaultChartOptions(defaultOptions: any, providedOptions: any) {\n\tconst clonedDefaultOptions = cloneDeep(defaultOptions)\n\tconst providedAxesNames = Object.keys(providedOptions.axes || {})\n\n\t// Use provide controls list if it exists\n\t// Prevents merging and element overriding of the two lists\n\tif (providedOptions?.toolbar?.controls) {\n\t\tdelete clonedDefaultOptions.toolbar.controls\n\t}\n\n\tif (providedAxesNames.length === 0) {\n\t\tdelete clonedDefaultOptions.axes\n\t}\n\n\t// Update deprecated options to work with the tabular data format\n\t// Similar to the functionality in model.transformToTabularData()\n\tfor (const axisName in clonedDefaultOptions.axes) {\n\t\tif (providedAxesNames.includes(axisName)) {\n\t\t\tconst providedAxisOptions = providedOptions.axes[axisName]\n\n\t\t\tif (providedAxisOptions['primary'] || providedAxisOptions['secondary']) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/?path=/story/docs-tutorials--tabular-data-format'\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tconst identifier = providedAxisOptions['mapsTo']\n\t\t\tif (identifier === undefined || identifier === null) {\n\t\t\t\tconst scaleType = providedAxisOptions['scaleType']\n\n\t\t\t\tif (scaleType === undefined || scaleType === null) {\n\t\t\t\t\tprovidedAxisOptions['mapsTo'] = 'value'\n\t\t\t\t} else if (scaleType === ScaleTypes.TIME) {\n\t\t\t\t\tprovidedAxisOptions['mapsTo'] = 'date'\n\t\t\t\t} else if (scaleType === ScaleTypes.LABELS) {\n\t\t\t\t\tprovidedAxisOptions['mapsTo'] = 'key'\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tdelete clonedDefaultOptions.axes[axisName]\n\t\t}\n\t}\n\n\tupdateLegendAdditionalItems(clonedDefaultOptions, providedOptions)\n\n\treturn merge(clonedDefaultOptions, providedOptions)\n}\n\n/**************************************\n * DOM-related operations *\n *************************************/\n\n/**\n * Get width & height of an element\n *\n * @export\n * @param {any} el element to get dimensions from\n * @returns an object containing the width and height of el\n */\nexport function getDimensions(el: any) {\n\treturn {\n\t\twidth: parseFloat(el.style.width.replace('px', '') || el.offsetWidth),\n\t\theight: parseFloat(el.style.height.replace('px', '') || el.offsetHeight)\n\t}\n}\n\n/**\n * Gets elements' x and y translations from transform attribute or returns null\n *\n * @param {HTMLElement} elementRef\n * @returns an object containing the translated x and y values or null\n */\nexport function getTranslationValues(elementRef: HTMLElement) {\n\tif (!elementRef) {\n\t\treturn\n\t}\n\n\t// regex to ONLY get values for translate (instead of all rotate, translate, skew, etc)\n\tconst translateRegex = /translate\\([0-9]+\\.?[0-9]*,[0-9]+\\.?[0-9]*\\)/\n\n\tconst transformStr = elementRef.getAttribute('transform').match(translateRegex)\n\tif (!transformStr) {\n\t\treturn null\n\t}\n\n\t// check for the match\n\tif (transformStr[0]) {\n\t\tconst transforms = transformStr[0]\n\t\t\t.replace(/translate\\(/, '')\n\t\t\t.replace(/\\)/, '')\n\t\t\t.split(',')\n\n\t\treturn {\n\t\t\ttx: transforms[0],\n\t\t\tty: transforms[1]\n\t\t}\n\t}\n\treturn null\n}\n\n/**************************************\n * Formatting & calculations *\n *************************************/\n\n/**\n * Gets x and y coordinates from HTML transform attribute\n *\n * @export\n * @param transform string the transform attribute string ie. transform(x,y)\n * @returns Returns an object with x and y offsets of the transform\n */\nexport function getTransformOffsets(transform: string) {\n\tconst regExp = /\\(([^)]+)\\)/\n\tconst match = regExp.exec(transform)\n\n\tif (match && match.length > 1) {\n\t\tconst xyString = match[1].split(',')\n\n\t\tif (xyString.length > 1) {\n\t\t\treturn {\n\t\t\t\tx: parseFloat(xyString[0]),\n\t\t\t\ty: parseFloat(xyString[1])\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { x: 0, y: 0 }\n}\n\n/**\n * Returns string value for height/width using pixels if there isn't a specified unit of measure\n *\n * @param value string or number value to be checked for unit of measure\n */\nexport function formatWidthHeightValues(value: string | number) {\n\tconst stringValue = value.toString()\n\n\t// If the value provided contains any letters\n\t// Return it the same way\n\tif (stringValue.match(/[a-z]/i)) {\n\t\treturn stringValue\n\t}\n\n\treturn stringValue + 'px'\n}\n\n/**\n * Capitalizes first letter of a string\n *\n * @export\n * @param {any} word the input string to perform first letter capitalization with\n * @returns The transformed string after first letter is capitalized\n */\nexport function capitalizeFirstLetter(word: string) {\n\treturn word[0].toUpperCase() + word.slice(1)\n}\n\n/**\n * Get the percentage of a datapoint compared to the entire dataset.\n * @export\n * @param {any} item\n * @param {any} fullData\n * @param {string} key\n * @returns The percentage in the form of a number (1 significant digit if necessary)\n */\nexport function convertValueToPercentage(\n\titem: any,\n\tfullData: any,\n\tkey = 'value',\n\tentireValue = false\n) {\n\tconst percentage =\n\t\t(item / fullData.reduce((accum: number, val: any) => accum + val[key], 0)) * 100\n\t//in need for entire float percentage value\n\tif (entireValue) {\n\t\treturn percentage\n\t} else {\n\t\t// if the value has any significant figures, keep 1\n\t\treturn percentage % 1 !== 0 ? parseFloat(percentage.toFixed(1)) : percentage\n\t}\n}\n\n/**\n * Truncate the labels\n * @export\n * @param {any} fullText\n * @param {any} truncationType\n * @param {any} numCharacter\n * @returns Truncated text\n */\nexport function truncateLabel(fullText: any, truncationType: any, numCharacter: any) {\n\tif (numCharacter > fullText.length) {\n\t\treturn fullText\n\t}\n\tif (truncationType === TruncationTypes.MID_LINE) {\n\t\treturn fullText.substr(0, numCharacter / 2) + '...' + fullText.substr(-numCharacter / 2)\n\t} else if (truncationType === TruncationTypes.FRONT_LINE) {\n\t\treturn '...' + fullText.substr(-numCharacter)\n\t} else if (truncationType === TruncationTypes.END_LINE) {\n\t\treturn fullText.substr(0, numCharacter) + '...'\n\t}\n}\n\n/**\n * Update legend additional items\n * @param {any} defaultOptions\n * @param {any} providedOptions\n */\nexport function updateLegendAdditionalItems(defaultOptions: any, providedOptions: any) {\n\tconst defaultAdditionalItems = getProperty(defaultOptions, 'legend', 'additionalItems')\n\tconst userProvidedAdditionalItems = getProperty(providedOptions, 'legend', 'additionalItems')\n\n\t// Retain default legend additional items\n\tif (defaultAdditionalItems && userProvidedAdditionalItems) {\n\t\tconst providedTypes = userProvidedAdditionalItems.map((item: any) => item.type)\n\n\t\tconst defaultTypes = defaultAdditionalItems.map((item: any) => item.type)\n\n\t\t// Get default items in default options but not in provided options\n\t\tconst updatedDefaultItems = defaultLegendAdditionalItems.filter(\n\t\t\titem => defaultTypes.includes(item.type) && !providedTypes.includes(item.type)\n\t\t)\n\n\t\tdefaultOptions.legend.additionalItems = updatedDefaultItems\n\n\t\tprovidedOptions.legend.additionalItems = unionBy(\n\t\t\tupdatedDefaultItems,\n\t\t\tuserProvidedAdditionalItems,\n\t\t\t'name'\n\t\t)\n\t}\n}\n\n/**************************************\n * Object/array related checks *\n *************************************/\n\n/**\n * Compares two arrays to return the difference between two arrays' items.\n *\n * @export\n * @param {any[]} oldArray the array to check for missing items\n * @param {any[]} newArray the array to check for newly added items\n * @returns An object containing items missing (existing in oldArray but not newArray)\n * and items added (existing in newArray but not in oldArray). Object is of the form { missing: [], added: [] }\n */\nexport function arrayDifferences(oldArray: any[], newArray: any[]) {\n\tconst difference = {\n\t\tmissing: [] as any[],\n\t\tadded: [] as any[]\n\t}\n\n\toldArray.forEach((element: any) => {\n\t\tif (newArray.indexOf(element) === -1) {\n\t\t\tdifference.missing.push(element)\n\t\t}\n\t})\n\n\tnewArray.forEach((element: any) => {\n\t\tif (oldArray.indexOf(element) === -1) {\n\t\t\tdifference.added.push(element)\n\t\t}\n\t})\n\n\treturn difference\n}\n\n/**\n * Gets the duplicated keys from an array of data\n *\n * @export\n * @param {*} arr - array of data\n * @returns A list of the duplicated keys in data\n */\nexport function getDuplicateValues(arr: any) {\n\tconst values: any[] = []\n\tconst duplicateValues: any[] = []\n\n\tarr.forEach((value: any) => {\n\t\tif (values.indexOf(value) !== -1 && duplicateValues.indexOf(value) === -1) {\n\t\t\tduplicateValues.push(value)\n\t\t}\n\n\t\tvalues.push(value)\n\t})\n\n\treturn duplicateValues\n}\n\n// ================================================================================\n// D3 Extensions\n// ================================================================================\n\n/**\n * In D3, moves an element to the front of the canvas\n *\n * @export\n * @param {any} element input element to moved in front\n * @returns The function to be used by D3 to push element to the top of the canvas\n */\nexport function moveToFront(element: any) {\n\treturn element.each(function () {\n\t\tthis.parentNode.appendChild(this)\n\t})\n}\n\n// ================================================================================\n// Style Helpers\n// ================================================================================\n\n/**\n * Gets a speicified property from within an object.\n *\n * @param object the object containing the property to retrieve\n * @param propPath nested properties used to extract the final property from within the object\n * (i.e \"style\", \"color\" would retrieve the color property from within an object that has \"color\" nested within \"style\")\n */\nexport const getProperty = (object: any, ...propPath: any) => {\n\tlet position = object\n\tif (position) {\n\t\tfor (const prop of propPath) {\n\t\t\tif (position[prop] !== null && position[prop] !== undefined) {\n\t\t\t\tposition = position[prop]\n\t\t\t} else {\n\t\t\t\treturn null\n\t\t\t}\n\t\t}\n\t\treturn position\n\t}\n\n\treturn null\n}\n\ninterface SVGPathCoordinates {\n\tx0: number\n\tx1: number\n\ty0: number\n\ty1: number\n}\n\nexport const flipSVGCoordinatesBasedOnOrientation = (\n\tverticalCoordinates: SVGPathCoordinates,\n\torientation?: CartesianOrientations\n) => {\n\tif (orientation === CartesianOrientations.HORIZONTAL) {\n\t\treturn {\n\t\t\ty0: verticalCoordinates.x0,\n\t\t\ty1: verticalCoordinates.x1,\n\t\t\tx0: verticalCoordinates.y0,\n\t\t\tx1: verticalCoordinates.y1\n\t\t}\n\t}\n\n\treturn verticalCoordinates\n}\n\nexport const generateSVGPathString = (\n\tverticalCoordinates: SVGPathCoordinates,\n\torientation?: CartesianOrientations\n) => {\n\tconst { x0, x1, y0, y1 } = flipSVGCoordinatesBasedOnOrientation(verticalCoordinates, orientation)\n\n\treturn `M${x0},${y0}L${x0},${y1}L${x1},${y1}L${x1},${y0}L${x0},${y0}`\n}\n\nexport function flipDomainAndRangeBasedOnOrientation(\n\tdomain: D,\n\trange: R,\n\torientation?: CartesianOrientations\n): [D, R] | [R, D] {\n\treturn orientation === CartesianOrientations.VERTICAL ? [domain, range] : [range, domain]\n}\n\nexport const compareNumeric = (a: Numeric, b: Numeric) => Number(a) === Number(b)\n","/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument) {\n const argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (\n argument instanceof Date ||\n (typeof argument === \"object\" && argStr === \"[object Date]\")\n ) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new argument.constructor(+argument);\n } else if (\n typeof argument === \"number\" ||\n argStr === \"[object Number]\" ||\n typeof argument === \"string\" ||\n argStr === \"[object String]\"\n ) {\n // TODO: Can we get rid of as?\n return new Date(argument);\n } else {\n // TODO: Can we get rid of as?\n return new Date(NaN);\n }\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from 'date-fns'\n *\n * // A function that clones a date preserving the original type\n * function cloneDate Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n","import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name addMonths\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of months to be added.\n *\n * @returns The new date with the months added\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * const result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n *\n * // Add one month to 30 January 2023:\n * const result = addMonths(new Date(2023, 0, 30), 1)\n * //=> Tue Feb 28 2023 00:00:00\n */\nexport function addMonths(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 months, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n const dayOfMonth = _date.getDate();\n\n // The JS Date object supports date math by accepting out-of-bounds values for\n // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and\n // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we\n // want except that dates will wrap around the end of a month, meaning that\n // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So\n // we'll default to the end of the desired month by adding 1 to the desired\n // month and using a date of 0 to back up one day to the end of the desired\n // month.\n const endOfDesiredMonth = constructFrom(date, _date.getTime());\n endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);\n const daysInMonth = endOfDesiredMonth.getDate();\n if (dayOfMonth >= daysInMonth) {\n // If we're already at the end of the month, then this is the correct date\n // and we're done.\n return endOfDesiredMonth;\n } else {\n // Otherwise, we now know that setting the original day-of-month value won't\n // cause an overflow, so set the desired day-of-month. Note that we can't\n // just set the date of `endOfDesiredMonth` because that object may have had\n // its time changed in the unusual case where where a DST transition was on\n // the last day of the month and its local time was in the hour skipped or\n // repeated next to a DST transition. So we use `date` instead which is\n // guaranteed to still have the original time.\n _date.setFullYear(\n endOfDesiredMonth.getFullYear(),\n endOfDesiredMonth.getMonth(),\n dayOfMonth,\n );\n return _date;\n }\n}\n\n// Fallback for modularized imports:\nexport default addMonths;\n","import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name addMilliseconds\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of milliseconds to be added.\n *\n * @returns The new date with the milliseconds added\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\nexport function addMilliseconds(date, amount) {\n const timestamp = +toDate(date);\n return constructFrom(date, timestamp + amount);\n}\n\n// Fallback for modularized imports:\nexport default addMilliseconds;\n","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n","import { addMilliseconds } from \"./addMilliseconds.mjs\";\nimport { millisecondsInHour } from \"./constants.mjs\";\n\n/**\n * @name addHours\n * @category Hour Helpers\n * @summary Add the specified number of hours to the given date.\n *\n * @description\n * Add the specified number of hours to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of hours to be added.\n *\n * @returns The new date with the hours added\n *\n * @example\n * // Add 2 hours to 10 July 2014 23:00:00:\n * const result = addHours(new Date(2014, 6, 10, 23, 0), 2)\n * //=> Fri Jul 11 2014 01:00:00\n */\nexport function addHours(date, amount) {\n return addMilliseconds(date, amount * millisecondsInHour);\n}\n\n// Fallback for modularized imports:\nexport default addHours;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { startOfWeek } from \"./startOfWeek.mjs\";\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date) {\n return startOfWeek(date, { weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date) {\n const _date = toDate(date);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const utcDate = new Date(\n Date.UTC(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}\n","import { millisecondsInDay } from \"./constants.mjs\";\nimport { startOfDay } from \"./startOfDay.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.mjs\";\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(dateLeft, dateRight) {\n const startOfDayLeft = startOfDay(dateLeft);\n const startOfDayRight = startOfDay(dateRight);\n\n const timestampLeft =\n +startOfDayLeft - getTimezoneOffsetInMilliseconds(startOfDayLeft);\n const timestampRight =\n +startOfDayRight - getTimezoneOffsetInMilliseconds(startOfDayRight);\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a day is not constant\n // (e.g. it's different in the day of the daylight saving time clock shift)\n return Math.trunc((timestampLeft - timestampRight) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","import { getISOWeekYear } from \"./getISOWeekYear.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date) {\n const year = getISOWeekYear(date);\n const fourthOfJanuary = constructFrom(date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n","import { addMilliseconds } from \"./addMilliseconds.mjs\";\nimport { millisecondsInMinute } from \"./constants.mjs\";\n\n/**\n * @name addMinutes\n * @category Minute Helpers\n * @summary Add the specified number of minutes to the given date.\n *\n * @description\n * Add the specified number of minutes to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of minutes to be added.\n *\n * @returns The new date with the minutes added\n *\n * @example\n * // Add 30 minutes to 10 July 2014 12:00:00:\n * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 12:30:00\n */\nexport function addMinutes(date, amount) {\n return addMilliseconds(date, amount * millisecondsInMinute);\n}\n\n// Fallback for modularized imports:\nexport default addMinutes;\n","import { addMilliseconds } from \"./addMilliseconds.mjs\";\n\n/**\n * @name addSeconds\n * @category Second Helpers\n * @summary Add the specified number of seconds to the given date.\n *\n * @description\n * Add the specified number of seconds to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of seconds to be added.\n *\n * @returns The new date with the seconds added\n *\n * @example\n * // Add 30 seconds to 10 July 2014 12:45:00:\n * const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:45:30\n */\nexport function addSeconds(date, amount) {\n return addMilliseconds(date, amount * 1000);\n}\n\n// Fallback for modularized imports:\nexport default addSeconds;\n","import { addMonths } from \"./addMonths.mjs\";\n\n/**\n * @name addYears\n * @category Year Helpers\n * @summary Add the specified number of years to the given date.\n *\n * @description\n * Add the specified number of years to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of years to be added.\n *\n * @returns The new date with the years added\n *\n * @example\n * // Add 5 years to 1 September 2014:\n * const result = addYears(new Date(2014, 8, 1), 5)\n * //=> Sun Sep 01 2019 00:00:00\n */\nexport function addYears(date, amount) {\n return addMonths(date, amount * 12);\n}\n\n// Fallback for modularized imports:\nexport default addYears;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name compareAsc\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The first date to compare\n * @param dateRight - The second date to compare\n *\n * @returns The result of the comparison\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * const result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * // Wed Feb 11 1987 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Sun Jul 02 1995 00:00:00\n * // ]\n */\nexport function compareAsc(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n const diff = _dateLeft.getTime() - _dateRight.getTime();\n\n if (diff < 0) {\n return -1;\n } else if (diff > 0) {\n return 1;\n // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}\n\n// Fallback for modularized imports:\nexport default compareAsc;\n","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n","import { isDate } from \"./isDate.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n if (!isDate(date) && typeof date !== \"number\") {\n return false;\n }\n const _date = toDate(date);\n return !isNaN(Number(_date));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name differenceInCalendarMonths\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of calendar months\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInCalendarMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 8\n */\nexport function differenceInCalendarMonths(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n const yearDiff = _dateLeft.getFullYear() - _dateRight.getFullYear();\n const monthDiff = _dateLeft.getMonth() - _dateRight.getMonth();\n\n return yearDiff * 12 + monthDiff;\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarMonths;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name differenceInCalendarYears\n * @category Year Helpers\n * @summary Get the number of calendar years between the given dates.\n *\n * @description\n * Get the number of calendar years between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n\n * @returns The number of calendar years\n *\n * @example\n * // How many calendar years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInCalendarYears(\n * new Date(2015, 1, 11),\n * new Date(2013, 11, 31)\n * )\n * //=> 2\n */\nexport function differenceInCalendarYears(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n return _dateLeft.getFullYear() - _dateRight.getFullYear();\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarYears;\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name differenceInDays\n * @category Day Helpers\n * @summary Get the number of full days between the given dates.\n *\n * @description\n * Get the number of full day periods between two dates. Fractional days are\n * truncated towards zero.\n *\n * One \"full day\" is the distance between a local time in one day to the same\n * local time on the next or previous day. A full day can sometimes be less than\n * or more than 24 hours if a daylight savings change happens between two dates.\n *\n * To ignore DST and only measure exact 24-hour periods, use this instead:\n * `Math.trunc(differenceInHours(dateLeft, dateRight)/24)|0`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of full days according to the local timezone\n *\n * @example\n * // How many full days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 365\n *\n * @example\n * // How many full days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 0\n *\n * @example\n * // How many full days are between\n * // 1 March 2020 0:00 and 1 June 2020 0:00 ?\n * // Note: because local time is used, the\n * // result will always be 92 days, even in\n * // time zones where DST starts and the\n * // period has only 92*24-1 hours.\n * const result = differenceInDays(\n * new Date(2020, 5, 1),\n * new Date(2020, 2, 1)\n * )\n * //=> 92\n */\nexport function differenceInDays(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n const sign = compareLocalAsc(_dateLeft, _dateRight);\n const difference = Math.abs(differenceInCalendarDays(_dateLeft, _dateRight));\n\n _dateLeft.setDate(_dateLeft.getDate() - sign * difference);\n\n // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full\n // If so, result must be decreased by 1 in absolute value\n const isLastDayNotFull = Number(\n compareLocalAsc(_dateLeft, _dateRight) === -sign,\n );\n const result = sign * (difference - isLastDayNotFull);\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}\n\n// Like `compareAsc` but uses local time not UTC, which is needed\n// for accurate equality comparisons of UTC timestamps that end up\n// having the same representation in local time, e.g. one hour before\n// DST ends vs. the instant that DST ends.\nfunction compareLocalAsc(dateLeft, dateRight) {\n const diff =\n dateLeft.getFullYear() - dateRight.getFullYear() ||\n dateLeft.getMonth() - dateRight.getMonth() ||\n dateLeft.getDate() - dateRight.getDate() ||\n dateLeft.getHours() - dateRight.getHours() ||\n dateLeft.getMinutes() - dateRight.getMinutes() ||\n dateLeft.getSeconds() - dateRight.getSeconds() ||\n dateLeft.getMilliseconds() - dateRight.getMilliseconds();\n\n if (diff < 0) {\n return -1;\n } else if (diff > 0) {\n return 1;\n // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}\n\n// Fallback for modularized imports:\nexport default differenceInDays;\n","export function getRoundingMethod(method) {\n return (number) => {\n const round = method ? Math[method] : Math.trunc;\n const result = round(number);\n // Prevent negative zero\n return result === 0 ? 0 : result;\n };\n}\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of milliseconds\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nexport function differenceInMilliseconds(dateLeft, dateRight) {\n return +toDate(dateLeft) - +toDate(dateRight);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMilliseconds;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.mjs\";\nimport { millisecondsInHour } from \"./constants.mjs\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.mjs\";\n\n/**\n * The {@link differenceInHours} function options.\n */\n\n/**\n * @name differenceInHours\n * @category Hour Helpers\n * @summary Get the number of hours between the given dates.\n *\n * @description\n * Get the number of hours between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of hours\n *\n * @example\n * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?\n * const result = differenceInHours(\n * new Date(2014, 6, 2, 19, 0),\n * new Date(2014, 6, 2, 6, 50)\n * )\n * //=> 12\n */\nexport function differenceInHours(dateLeft, dateRight, options) {\n const diff =\n differenceInMilliseconds(dateLeft, dateRight) / millisecondsInHour;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInHours;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.mjs\";\nimport { millisecondsInMinute } from \"./constants.mjs\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.mjs\";\n\n/**\n * The {@link differenceInMinutes} function options.\n */\n\n/**\n * @name differenceInMinutes\n * @category Minute Helpers\n * @summary Get the number of minutes between the given dates.\n *\n * @description\n * Get the signed number of full (rounded towards 0) minutes between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of minutes\n *\n * @example\n * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?\n * const result = differenceInMinutes(\n * new Date(2014, 6, 2, 12, 20, 0),\n * new Date(2014, 6, 2, 12, 7, 59)\n * )\n * //=> 12\n *\n * @example\n * // How many minutes are between 10:01:59 and 10:00:00\n * const result = differenceInMinutes(\n * new Date(2000, 0, 1, 10, 0, 0),\n * new Date(2000, 0, 1, 10, 1, 59)\n * )\n * //=> -1\n */\nexport function differenceInMinutes(dateLeft, dateRight, options) {\n const diff =\n differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMinutes;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name endOfDay\n * @category Day Helpers\n * @summary Return the end of a day for the given date.\n *\n * @description\n * Return the end of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The end of a day\n *\n * @example\n * // The end of a day for 2 September 2014 11:55:00:\n * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 23:59:59.999\n */\nexport function endOfDay(date) {\n const _date = toDate(date);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfDay;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The end of a month\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\nexport function endOfMonth(date) {\n const _date = toDate(date);\n const month = _date.getMonth();\n _date.setFullYear(_date.getFullYear(), month + 1, 0);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfMonth;\n","import { endOfDay } from \"./endOfDay.mjs\";\nimport { endOfMonth } from \"./endOfMonth.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isLastDayOfMonth\n * @category Month Helpers\n * @summary Is the given date the last day of a month?\n *\n * @description\n * Is the given date the last day of a month?\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n\n * @returns The date is the last day of a month\n *\n * @example\n * // Is 28 February 2014 the last day of a month?\n * const result = isLastDayOfMonth(new Date(2014, 1, 28))\n * //=> true\n */\nexport function isLastDayOfMonth(date) {\n const _date = toDate(date);\n return +endOfDay(_date) === +endOfMonth(_date);\n}\n\n// Fallback for modularized imports:\nexport default isLastDayOfMonth;\n","import { compareAsc } from \"./compareAsc.mjs\";\nimport { differenceInCalendarMonths } from \"./differenceInCalendarMonths.mjs\";\nimport { isLastDayOfMonth } from \"./isLastDayOfMonth.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name differenceInMonths\n * @category Month Helpers\n * @summary Get the number of full months between the given dates.\n *\n * @description\n * Get the number of full months between the given dates using trunc as a default rounding method.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of full months\n *\n * @example\n * // How many full months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))\n * //=> 7\n */\nexport function differenceInMonths(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n const sign = compareAsc(_dateLeft, _dateRight);\n const difference = Math.abs(\n differenceInCalendarMonths(_dateLeft, _dateRight),\n );\n let result;\n\n // Check for the difference of less than month\n if (difference < 1) {\n result = 0;\n } else {\n if (_dateLeft.getMonth() === 1 && _dateLeft.getDate() > 27) {\n // This will check if the date is end of Feb and assign a higher end of month date\n // to compare it with Jan\n _dateLeft.setDate(30);\n }\n\n _dateLeft.setMonth(_dateLeft.getMonth() - sign * difference);\n\n // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full\n // If so, result must be decreased by 1 in absolute value\n let isLastMonthNotFull = compareAsc(_dateLeft, _dateRight) === -sign;\n\n // Check for cases of one full calendar month\n if (\n isLastDayOfMonth(toDate(dateLeft)) &&\n difference === 1 &&\n compareAsc(dateLeft, _dateRight) === 1\n ) {\n isLastMonthNotFull = false;\n }\n\n result = sign * (difference - Number(isLastMonthNotFull));\n }\n\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}\n\n// Fallback for modularized imports:\nexport default differenceInMonths;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.mjs\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.mjs\";\n\n/**\n * The {@link differenceInSeconds} function options.\n */\n\n/**\n * @name differenceInSeconds\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of seconds\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * const result = differenceInSeconds(\n * new Date(2014, 6, 2, 12, 30, 20, 0),\n * new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\nexport function differenceInSeconds(dateLeft, dateRight, options) {\n const diff = differenceInMilliseconds(dateLeft, dateRight) / 1000;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInSeconds;\n","import { compareAsc } from \"./compareAsc.mjs\";\nimport { differenceInCalendarYears } from \"./differenceInCalendarYears.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name differenceInYears\n * @category Year Helpers\n * @summary Get the number of full years between the given dates.\n *\n * @description\n * Get the number of full years between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of full years\n *\n * @example\n * // How many full years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31))\n * //=> 1\n */\nexport function differenceInYears(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n const sign = compareAsc(_dateLeft, _dateRight);\n const difference = Math.abs(differenceInCalendarYears(_dateLeft, _dateRight));\n\n // Set both dates to a valid leap year for accurate comparison when dealing\n // with leap days\n _dateLeft.setFullYear(1584);\n _dateRight.setFullYear(1584);\n\n // Math.abs(diff in full years - diff in calendar years) === 1 if last calendar year is not full\n // If so, result must be decreased by 1 in absolute value\n const isLastYearNotFull = compareAsc(_dateLeft, _dateRight) === -sign;\n const result = sign * (difference - +isLastYearNotFull);\n\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}\n\n// Fallback for modularized imports:\nexport default differenceInYears;\n","import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date) {\n const cleanDate = toDate(date);\n const _date = constructFrom(date, 0);\n _date.setFullYear(cleanDate.getFullYear(), 0, 1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n","export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","/* eslint-disable no-unused-vars */\n\n/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\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 ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { formatDistance } from \"./en-US/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./en-US/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.mjs\";\nimport { localize } from \"./en-US/_lib/localize.mjs\";\nimport { match } from \"./en-US/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.mjs\";\nimport { startOfYear } from \"./startOfYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date) {\n const _date = toDate(date);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date) {\n const _date = toDate(date);\n const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.trunc(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getWeekYear } from \"./getWeekYear.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { startOfWeekYear } from \"./startOfWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\n\nexport function getWeek(date, options) {\n const _date = toDate(date);\n const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.trunc(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n","export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n","import { addLeadingZeros } from \"../addLeadingZeros.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.trunc(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n","import { getDayOfYear } from \"../../getDayOfYear.mjs\";\nimport { getISOWeek } from \"../../getISOWeek.mjs\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.mjs\";\nimport { getWeek } from \"../../getWeek.mjs\";\nimport { getWeekYear } from \"../../getWeekYear.mjs\";\nimport { addLeadingZeros } from \"../addLeadingZeros.mjs\";\nimport { lightFormatters } from \"./lightFormatters.mjs\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize) {\n const timestamp = Math.trunc(date.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize) {\n const timestamp = date.getTime();\n return addLeadingZeros(timestamp, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.trunc(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n","const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n","const dayOfYearTokenRE = /^D+$/;\nconst weekYearTokenRE = /^Y+$/;\n\nconst throwTokens = [\"D\", \"DD\", \"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return dayOfYearTokenRE.test(token);\n}\n\nexport function isProtectedWeekYearToken(token) {\n return weekYearTokenRE.test(token);\n}\n\nexport function warnOrThrowProtectedError(token, format, input) {\n const _message = message(token, format, input);\n console.warn(_message);\n if (throwTokens.includes(token)) throw new RangeError(_message);\n}\n\nfunction message(token, format, input) {\n const subject = token[0] === \"Y\" ? \"years\" : \"days of the month\";\n return `Use \\`${token.toLowerCase()}\\` instead of \\`${token}\\` (in \\`${format}\\`) for formatting ${subject} to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;\n}\n","import { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\nimport { formatters } from \"./_lib/format/formatters.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n warnOrThrowProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\nimport { isValid } from \"./isValid.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { formatters, longFormatters };\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\nexport { format as formatDate };\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @alias formatDate\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n let parts = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map((substring) => {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return { isToken: false, value: \"'\" };\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return { isToken: false, value: cleanEscapedString(substring) };\n }\n\n if (formatters[firstCharacter]) {\n return { isToken: true, value: substring };\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return { isToken: false, value: substring };\n });\n\n // invoke localize preprocessor (only for french locales at the moment)\n if (locale.localize.preprocessor) {\n parts = locale.localize.preprocessor(originalDate, parts);\n }\n\n const formatterOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n return parts\n .map((part) => {\n if (!part.isToken) return part.value;\n\n const token = part.value;\n\n if (\n (!options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)) ||\n (!options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token))\n ) {\n warnOrThrowProtectedError(token, formatStr, String(date));\n }\n\n const formatter = formatters[token[0]];\n return formatter(originalDate, token, locale.localize, formatterOptions);\n })\n .join(\"\");\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n","import { addDays } from \"./addDays.mjs\";\n\n/**\n * @name subDays\n * @category Day Helpers\n * @summary Subtract the specified number of days from the given date.\n *\n * @description\n * Subtract the specified number of days from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of days to be subtracted.\n *\n * @returns The new date with the days subtracted\n *\n * @example\n * // Subtract 10 days from 1 September 2014:\n * const result = subDays(new Date(2014, 8, 1), 10)\n * //=> Fri Aug 22 2014 00:00:00\n */\nexport function subDays(date, amount) {\n return addDays(date, -amount);\n}\n\n// Fallback for modularized imports:\nexport default subDays;\n","import { addMonths } from \"./addMonths.mjs\";\n\n/**\n * @name subMonths\n * @category Month Helpers\n * @summary Subtract the specified number of months from the given date.\n *\n * @description\n * Subtract the specified number of months from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of months to be subtracted.\n *\n * @returns The new date with the months subtracted\n *\n * @example\n * // Subtract 5 months from 1 February 2015:\n * const result = subMonths(new Date(2015, 1, 1), 5)\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function subMonths(date, amount) {\n return addMonths(date, -amount);\n}\n\n// Fallback for modularized imports:\nexport default subMonths;\n","import { addHours } from \"./addHours.mjs\";\n\n/**\n * @name subHours\n * @category Hour Helpers\n * @summary Subtract the specified number of hours from the given date.\n *\n * @description\n * Subtract the specified number of hours from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of hours to be subtracted.\n *\n * @returns The new date with the hours subtracted\n *\n * @example\n * // Subtract 2 hours from 11 July 2014 01:00:00:\n * const result = subHours(new Date(2014, 6, 11, 1, 0), 2)\n * //=> Thu Jul 10 2014 23:00:00\n */\nexport function subHours(date, amount) {\n return addHours(date, -amount);\n}\n\n// Fallback for modularized imports:\nexport default subHours;\n","import { addMinutes } from \"./addMinutes.mjs\";\n\n/**\n * @name subMinutes\n * @category Minute Helpers\n * @summary Subtract the specified number of minutes from the given date.\n *\n * @description\n * Subtract the specified number of minutes from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of minutes to be subtracted.\n *\n * @returns The new date with the minutes subtracted\n *\n * @example\n * // Subtract 30 minutes from 10 July 2014 12:00:00:\n * const result = subMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 11:30:00\n */\nexport function subMinutes(date, amount) {\n return addMinutes(date, -amount);\n}\n\n// Fallback for modularized imports:\nexport default subMinutes;\n","import { addSeconds } from \"./addSeconds.mjs\";\n\n/**\n * @name subSeconds\n * @category Second Helpers\n * @summary Subtract the specified number of seconds from the given date.\n *\n * @description\n * Subtract the specified number of seconds from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of seconds to be subtracted.\n *\n * @returns The new date with the seconds subtracted\n *\n * @example\n * // Subtract 30 seconds from 10 July 2014 12:45:00:\n * const result = subSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:44:30\n */\nexport function subSeconds(date, amount) {\n return addSeconds(date, -amount);\n}\n\n// Fallback for modularized imports:\nexport default subSeconds;\n","import { addYears } from \"./addYears.mjs\";\n\n/**\n * @name subYears\n * @category Year Helpers\n * @summary Subtract the specified number of years from the given date.\n *\n * @description\n * Subtract the specified number of years from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of years to be subtracted.\n *\n * @returns The new date with the years subtracted\n *\n * @example\n * // Subtract 5 years from 1 September 2014:\n * const result = subYears(new Date(2014, 8, 1), 5)\n * //=> Tue Sep 01 2009 00:00:00\n */\nexport function subYears(date, amount) {\n return addYears(date, -amount);\n}\n\n// Fallback for modularized imports:\nexport default subYears;\n","import { enUS as localeObject } from 'date-fns/locale'\nimport { merge } from 'lodash-es'\nimport { circlePack } from './configuration-non-customizable'\nimport type {\n\tAlluvialChartOptions,\n\tAreaChartOptions,\n\tAxisChartOptions,\n\tBarChartOptions,\n\tBaseChartOptions,\n\tBoxplotChartOptions,\n\tBubbleChartOptions,\n\tBulletChartOptions,\n\tChoroplethChartOptions,\n\tCirclePackChartOptions,\n\tComboChartOptions,\n\tDonutChartOptions,\n\tGaugeChartOptions,\n\tHeatmapChartOptions,\n\tHistogramChartOptions,\n\tLollipopChartOptions,\n\tLineChartOptions,\n\tMeterChartOptions,\n\tPieChartOptions,\n\tProportionalMeterChartOptions,\n\tRadarChartOptions,\n\tScatterChartOptions,\n\tStackedBarChartOptions,\n\tThematicChartOptions,\n\tTreeChartOptions,\n\tTreemapChartOptions,\n\tWordCloudChartTooltipOptions,\n\tWorldCloudChartOptions\n} from '@/interfaces/charts'\nimport {\n\tAlignments,\n\tGaugeTypes,\n\tLegendPositions,\n\tTruncationTypes,\n\tToolbarControlTypes,\n\tZoomBarTypes,\n\tLegendItemType,\n\tTreeTypes,\n\tDividerStatus,\n\tProjection,\n\tChartTheme\n} from '@/interfaces/enums'\nimport type { AxesOptions, AxisOptions, TimeScaleOptions } from '@/interfaces/axis-scales'\nimport type {\n\tGridOptions,\n\tRulerOptions,\n\tTooltipOptions,\n\tLegendOptions,\n\tStackedBarOptions,\n\tToolbarOptions,\n\tZoomBarsOptions\n} from '@/interfaces/components'\n\n/*\n *****************************\n * User configurable options *\n *****************************\n */\n\n/**\n * Default truncation configuration\n */\nconst standardTruncationOptions = {\n\ttype: TruncationTypes.END_LINE,\n\tthreshold: 16,\n\tnumCharacter: 14\n}\n\n/**\n * Legend options\n */\nconst legend: LegendOptions = {\n\tenabled: true,\n\tposition: LegendPositions.BOTTOM,\n\tclickable: true,\n\ttruncation: standardTruncationOptions,\n\talignment: Alignments.LEFT,\n\torder: null,\n\tadditionalItems: []\n}\n\n/**\n * Grid options\n */\nexport const grid: GridOptions = {\n\tx: {\n\t\t// set enable to false will not draw grid and stroke of grid backdrop\n\t\tenabled: true,\n\t\tnumberOfTicks: 15,\n\t\talignWithAxisTicks: false\n\t},\n\ty: {\n\t\t// set enable to false will not draw grid and stroke of grid backdrop\n\t\tenabled: true,\n\t\tnumberOfTicks: 5,\n\t\talignWithAxisTicks: false\n\t}\n}\n\n/**\n * Ruler options\n */\nexport const ruler: RulerOptions = {\n\t// enable or disable ruler\n\tenabled: true\n}\n\n/**\n * Tooltip options\n */\nexport const baseTooltip: TooltipOptions = {\n\tenabled: true,\n\tshowTotal: true,\n\ttruncation: standardTruncationOptions,\n\tgroupLabel: 'Group'\n}\n\n// These options will be managed by merge()\n// by removing the ones the user is not providing,\n// and by TwoDimensionalAxes.\nconst axes: AxesOptions = {\n\ttop: {\n\t\tvisible: true,\n\t\tincludeZero: true,\n\t\ttruncation: standardTruncationOptions\n\t},\n\tbottom: {\n\t\tvisible: true,\n\t\tincludeZero: true,\n\t\ttruncation: standardTruncationOptions\n\t},\n\tleft: {\n\t\tvisible: true,\n\t\tincludeZero: true,\n\t\ttruncation: standardTruncationOptions\n\t},\n\tright: {\n\t\tvisible: true,\n\t\tincludeZero: true,\n\t\ttruncation: standardTruncationOptions\n\t}\n}\n\nexport const timeScale: TimeScaleOptions = {\n\taddSpaceOnEdges: 1,\n\tshowDayName: false,\n\tlocaleObject,\n\ttimeIntervalFormats: {\n\t\t'15seconds': { primary: 'MMM d, pp', secondary: 'pp' },\n\t\tminute: { primary: 'MMM d, p', secondary: 'p' },\n\t\t'30minutes': { primary: 'MMM d, p', secondary: 'p' },\n\t\thourly: { primary: 'MMM d, hh a', secondary: 'hh a' },\n\t\tdaily: { primary: 'MMM d', secondary: 'd' },\n\t\tweekly: { primary: 'eee, MMM d', secondary: 'eee' },\n\t\tmonthly: { primary: 'MMM yyyy', secondary: 'MMM' },\n\t\tquarterly: { primary: \"QQQ ''yy\", secondary: 'QQQ' },\n\t\tyearly: { primary: 'yyyy', secondary: 'yyyy' }\n\t}\n}\n\nconst isFullScreenEnabled =\n\ttypeof document !== 'undefined' &&\n\t(document['fullscreenEnabled'] ||\n\t\tdocument['webkitFullscreenEnabled'] ||\n\t\tdocument['mozFullScreenEnabled'] ||\n\t\tdocument['msFullscreenEnabled'])\n\n/**\n * Base chart options common to any chart\n */\nconst chart: BaseChartOptions = {\n\twidth: null,\n\theight: null,\n\tresizable: true,\n\ttheme: ChartTheme.WHITE,\n\ttooltip: baseTooltip,\n\tlegend,\n\tstyle: {\n\t\tprefix: 'cc'\n\t},\n\tdata: {\n\t\tgroupMapsTo: 'group',\n\t\tloading: false,\n\t\tselectedGroups: []\n\t},\n\tcolor: {\n\t\tscale: null,\n\t\tpairing: {\n\t\t\tnumberOfVariants: null,\n\t\t\toption: 1\n\t\t},\n\t\tgradient: {\n\t\t\tenabled: false\n\t\t}\n\t},\n\ttoolbar: {\n\t\tenabled: true,\n\t\tnumberOfIcons: 3,\n\t\tcontrols: [\n\t\t\t{\n\t\t\t\ttype: ToolbarControlTypes.SHOW_AS_DATATABLE\n\t\t\t},\n\t\t\t...(isFullScreenEnabled\n\t\t\t\t? [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: ToolbarControlTypes.MAKE_FULLSCREEN\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t: []),\n\t\t\t{\n\t\t\t\ttype: ToolbarControlTypes.EXPORT_CSV\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: ToolbarControlTypes.EXPORT_PNG\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: ToolbarControlTypes.EXPORT_JPG\n\t\t\t}\n\t\t]\n\t} as ToolbarOptions\n}\n\n/**\n * Options common to any thematic chart\n */\nconst thematicChart: ThematicChartOptions = merge({}, chart, {\n\tthematic: {\n\t\tprojection: Projection.geoNaturalEarth1\n\t}\n})\n\n/**\n * Options common to any chart with an axis\n */\nconst axisChart: AxisChartOptions = merge({}, chart, {\n\taxes,\n\ttimeScale,\n\tgrid,\n\truler,\n\tzoomBar: {\n\t\tzoomRatio: 0.4,\n\t\tminZoomRatio: 0.01,\n\t\ttop: {\n\t\t\tenabled: false,\n\t\t\ttype: ZoomBarTypes.GRAPH_VIEW\n\t\t}\n\t} as ZoomBarsOptions\n} as AxisChartOptions)\n\n/**\n * options specific to simple bar charts\n */\nconst baseBarChart: BarChartOptions = merge({}, axisChart, {\n\tbars: {\n\t\tmaxWidth: 16,\n\t\tspacingFactor: 0.25\n\t},\n\ttimeScale: merge(timeScale, {\n\t\taddSpaceOnEdges: 1\n\t} as TimeScaleOptions)\n} as BarChartOptions)\n\n/**\n * options specific to simple bar charts\n */\nconst simpleBarChart: BarChartOptions = merge({}, baseBarChart, {} as BarChartOptions)\n\n/**\n * options specific to simple bar charts\n */\nconst groupedBarChart: BarChartOptions = merge({}, baseBarChart, {} as BarChartOptions)\n\n/**\n * options specific to stacked bar charts\n */\nconst stackedBarChart: StackedBarChartOptions = merge({}, baseBarChart, {\n\tbars: merge({}, baseBarChart.bars, {\n\t\tdividerSize: 1.5\n\t} as StackedBarOptions)\n} as BarChartOptions)\n\n/**\n * options specific to boxplot charts\n */\nconst boxplotChart: BoxplotChartOptions = merge({}, baseBarChart, {} as BarChartOptions)\n\n/**\n * options specific to scatter charts\n */\nconst scatterChart: ScatterChartOptions = merge({}, axisChart, {\n\tpoints: {\n\t\t// default point radius to 4\n\t\tradius: 4,\n\t\tfillOpacity: 0.3,\n\t\tfilled: true,\n\t\tenabled: true\n\t}\n} as ScatterChartOptions)\n\n/**\n * options specific to lollipop charts\n */\nconst lollipopChart: LollipopChartOptions = scatterChart as LollipopChartOptions\n\n/**\n * options specific to line charts\n */\nconst lineChart: LineChartOptions = merge({}, scatterChart, {\n\tpoints: {\n\t\t// default point radius to 3\n\t\tradius: 3,\n\t\tfilled: false,\n\t\tenabled: true\n\t}\n} as LineChartOptions)\n\n/**\n * options specific to area charts\n */\nconst areaChart: AreaChartOptions = merge({}, lineChart, {\n\ttimeScale: merge(timeScale, {\n\t\taddSpaceOnEdges: 0\n\t} as TimeScaleOptions)\n} as LineChartOptions)\n\n/**\n * options specific to stacked area charts\n */\nconst stackedAreaChart = areaChart\n\n/**\n * options specific to bubble charts\n */\nconst bubbleChart: BubbleChartOptions = merge({}, axisChart, {\n\tbubble: {\n\t\tradiusMapsTo: 'radius',\n\t\tradiusLabel: 'Radius',\n\t\tradiusRange: (chartSize: any) => {\n\t\t\tconst smallerChartDimension = Math.min(chartSize.width, chartSize.height)\n\t\t\treturn [(smallerChartDimension * 3) / 400, (smallerChartDimension * 25) / 400]\n\t\t},\n\t\tfillOpacity: 0.2,\n\t\tenabled: true\n\t},\n\tpoints: {\n\t\tfilled: true\n\t},\n\tlegend: {\n\t\tadditionalItems: [\n\t\t\t{\n\t\t\t\ttype: LegendItemType.RADIUS,\n\t\t\t\tname: 'Radius'\n\t\t\t}\n\t\t]\n\t}\n} as BubbleChartOptions)\n\n/**\n * options specific to bullet charts\n */\nconst bulletChart: BulletChartOptions = merge({}, axisChart, {\n\tbullet: {\n\t\tperformanceAreaTitles: ['Poor', 'Satisfactory', 'Great']\n\t},\n\tgrid: {\n\t\tx: {\n\t\t\tenabled: false\n\t\t},\n\t\ty: {\n\t\t\tenabled: false\n\t\t}\n\t},\n\tlegend: {\n\t\tadditionalItems: [\n\t\t\t{\n\t\t\t\ttype: LegendItemType.AREA,\n\t\t\t\tname: 'Poor area'\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: LegendItemType.AREA,\n\t\t\t\tname: 'Satisfactory area'\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: LegendItemType.AREA,\n\t\t\t\tname: 'Great area'\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: LegendItemType.QUARTILE,\n\t\t\t\tname: 'Quartiles'\n\t\t\t}\n\t\t]\n\t}\n} as BulletChartOptions)\n\n/**\n * options specific to stacked bar charts\n */\nconst histogramChart: HistogramChartOptions = merge({}, baseBarChart, {\n\tbars: {\n\t\tdividerSize: 1.5\n\t} as StackedBarOptions,\n\ttimeScale: merge(timeScale, {\n\t\taddSpaceOnEdges: 0\n\t} as TimeScaleOptions)\n} as BarChartOptions)\n\n/*\n * options specific to word cloud charts\n */\nconst wordCloudChart: WorldCloudChartOptions = merge({}, chart, {\n\ttooltip: merge({}, baseTooltip, {\n\t\twordLabel: 'Word',\n\t\tvalueLabel: 'Value'\n\t}) as WordCloudChartTooltipOptions,\n\twordCloud: {\n\t\tfontSizeMapsTo: 'value',\n\t\tfontSizeRange: (chartSize: any) => {\n\t\t\tconst smallerChartDimension = Math.min(chartSize.width, chartSize.height)\n\t\t\treturn [(smallerChartDimension * 20) / 400, (smallerChartDimension * 75) / 400]\n\t\t},\n\t\twordMapsTo: 'word'\n\t}\n} as WorldCloudChartOptions)\n\n/**\n * options specific to pie charts\n */\nconst pieChart: PieChartOptions = merge({}, chart, {\n\tpie: {\n\t\tlabels: {\n\t\t\tformatter: null,\n\t\t\tenabled: true\n\t\t},\n\t\talignment: Alignments.LEFT,\n\t\tsortFunction: null,\n\t\tvalueMapsTo: 'value'\n\t}\n} as PieChartOptions)\n\n/**\n * options specific to gauge charts\n */\nconst gaugeChart: GaugeChartOptions = merge({}, chart, {\n\tlegend: {\n\t\tenabled: false\n\t},\n\tgauge: {\n\t\ttype: GaugeTypes.SEMI,\n\t\tarcWidth: 16,\n\t\tdeltaArrow: {\n\t\t\tsize: (radius: number) => radius / 8,\n\t\t\tenabled: true\n\t\t},\n\t\tshowPercentageSymbol: true,\n\t\tstatus: null,\n\t\tnumberSpacing: 10,\n\t\tdeltaFontSize: (radius: number) => radius / 8,\n\t\tvalueFontSize: (radius: number) => radius / 2.5,\n\t\tnumberFormatter: (value: number) =>\n\t\t\tNumber(value.toFixed(2)) % 1 !== 0\n\t\t\t\t? value.toFixed(2).toLocaleString()\n\t\t\t\t: value.toFixed().toLocaleString(),\n\t\talignment: Alignments.LEFT\n\t}\n} as GaugeChartOptions)\n\n/**\n * options specific to donut charts\n */\nconst donutChart: DonutChartOptions = merge({}, pieChart, {\n\tdonut: {\n\t\tcenter: {\n\t\t\tnumberFontSize: radius => `${Math.min((radius / 100) * 24, 24)}px`,\n\t\t\ttitleFontSize: radius => `${Math.min((radius / 100) * 15, 15)}px`,\n\t\t\ttitleYPosition: radius => Math.min((radius / 80) * 20, 20),\n\t\t\tnumberFormatter: number => Math.floor(number).toLocaleString()\n\t\t},\n\t\talignment: Alignments.LEFT\n\t}\n} as DonutChartOptions)\n\nconst meterChart: MeterChartOptions = merge({}, chart, {\n\tlegend: {\n\t\tenabled: false,\n\t\tclickable: false\n\t},\n\tmeter: {\n\t\tshowLabels: true,\n\t\tproportional: null,\n\t\tstatusBar: {\n\t\t\tpercentageIndicator: {\n\t\t\t\tenabled: true\n\t\t\t}\n\t\t}\n\t}\n} as MeterChartOptions)\n\nconst proportionalMeterChart: ProportionalMeterChartOptions = merge({}, meterChart, {\n\tlegend: {\n\t\tenabled: true\n\t}\n} as MeterChartOptions)\n\n/**\n * options specific to radar charts\n */\nconst radarChart: RadarChartOptions = merge({}, chart, {\n\tradar: {\n\t\taxes: {\n\t\t\tangle: 'key',\n\t\t\tvalue: 'value'\n\t\t},\n\t\talignment: Alignments.LEFT\n\t},\n\ttooltip: {\n\t\tgridline: {\n\t\t\tenabled: true\n\t\t},\n\t\tvalueFormatter: value => (value !== null && value !== undefined ? value : 'N/A')\n\t}\n} as RadarChartOptions)\n\n/**\n * options specific to combo charts\n */\nconst comboChart: ComboChartOptions = merge({}, baseBarChart, {\n\tcomboChartTypes: []\n} as ComboChartOptions)\n\n/*\n * options specific to tree charts\n */\nconst treeChart: TreeChartOptions = merge(\n\t{\n\t\ttree: {\n\t\t\ttype: TreeTypes.TREE\n\t\t}\n\t},\n\tchart,\n\t{} as TreeChartOptions\n)\n\n/*\n * options specific to treemap charts\n */\nconst treemapChart: TreemapChartOptions = merge({}, chart, {\n\tdata: merge(chart.data, {\n\t\tgroupMapsTo: 'name'\n\t})\n} as TreemapChartOptions)\n\n/*\n * options specific to circle pack charts\n */\nconst circlePackChart: CirclePackChartOptions = merge({}, chart, circlePack, {\n\tdata: merge(chart.data, {\n\t\tgroupMapsTo: 'name'\n\t})\n} as CirclePackChartOptions)\n\nconst alluvialChart: AlluvialChartOptions = merge({}, chart, {\n\talluvial: {\n\t\tdata: merge(chart.data, {\n\t\t\tgroupMapsTo: 'source'\n\t\t}),\n\t\tnodeAlignment: Alignments.CENTER,\n\t\tnodePadding: 24,\n\t\tmonochrome: false,\n\t\tnodes: []\n\t}\n} as AlluvialChartOptions)\n\nconst heatmapChart: HeatmapChartOptions = merge({}, chart, {\n\taxes,\n\theatmap: {\n\t\tdivider: {\n\t\t\tstate: DividerStatus.AUTO\n\t\t},\n\t\tcolorLegend: {\n\t\t\ttype: 'linear'\n\t\t}\n\t}\n} as HeatmapChartOptions)\n\nconst choroplethChart: ChoroplethChartOptions = merge({}, thematicChart, {\n\tchoropleth: {\n\t\tcolorLegend: {\n\t\t\ttype: 'linear'\n\t\t}\n\t}\n} as ChoroplethChartOptions)\n\nexport const options = {\n\talluvialChart,\n\tareaChart,\n\taxisChart,\n\tboxplotChart,\n\tbubbleChart,\n\tbulletChart,\n\tchart,\n\tcirclePackChart,\n\tchoroplethChart,\n\tcomboChart,\n\tdonutChart,\n\tgaugeChart,\n\tgroupedBarChart,\n\theatmapChart,\n\thistogramChart,\n\tlineChart,\n\tlollipopChart,\n\tmeterChart,\n\tpieChart,\n\tproportionalMeterChart,\n\tradarChart,\n\tscatterChart,\n\tsimpleBarChart,\n\tstackedAreaChart,\n\tstackedBarChart,\n\tthematicChart,\n\ttreeChart,\n\ttreemapChart,\n\twordCloudChart\n}\n\nexport {\n\talluvial,\n\tarea,\n\taxis,\n\tboxplot,\n\tcanvasZoomSettings,\n\tcarbonPrefix,\n\tcirclePack,\n\tcolor,\n\tdefaultLegendAdditionalItems,\n\theatmap,\n\thistogram,\n\tlegend,\n\tlines,\n\tmeter,\n\tpie,\n\tradar,\n\tspacers,\n\ttooltips,\n\ttransitions,\n\ttoolbar,\n\tzoomBar\n} from './configuration-non-customizable'\n","import type { AxisDomain } from 'd3'\nimport type { Locale } from 'date-fns/locale'\nimport type { AxisTitleOrientations, ScaleTypes, TickRotations } from './enums'\nimport type { ThresholdOptions } from './components'\nimport type { TruncationOptions } from './truncation'\n\nexport interface BasedAxisOptions {\n\t/**\n\t * type of the scale used on axis\n\t */\n\tscaleType?: ScaleTypes\n\t/**\n\t * Whether the Axis should use the specified domain\n\t * instead of it being dynamically generated based on data extents.\n\t * The type of values should depend on the scale type.\n\t * Example for continuous axis scale: [-100, 100]\n\t * Example for discrete axis scale: ['Qty', 'More', 'Sold']\n\t * No need to define domain for percentage axis scale\n\t */\n\tdomain?: AxisDomain[]\n\t/**\n\t * an additional key from the charting data that is used to\n\t * extend the domain of an axis by\n\t * (e.g. in the bullet graph we need both the marker &\n\t * the data values to define the domain of the linear scale)\n\t */\n\textendLinearDomainBy?: string\n\t/**\n\t * Whether the Axis should be forced to include 0 as a starting point\n\t * (or ending point, in case of all negative axis).\n\t * Default: true\n\t */\n\tincludeZero?: boolean\n\t/**\n\t * identifies what key within the data the axis values would map to\n\t */\n\tmapsTo?: string\n\t/**\n\t * optional title for the scales\n\t */\n\ttitle?: string\n\t/**\n\t * Override for the orientation of the title (for vertical axes).\n\t * The title string can be overrided to be rotated left or right.\n\t */\n\ttitleOrientation?: AxisTitleOrientations\n\t/**\n\t * thresholds\n\t * @example\n\t * [\n\t *\t\t{ value: 10000 },\n\t *\t\t{ value: 40020, valueFormatter: (x) => x },\n\t *\t\t{ value: 55000, label: \"Custom label\", fillColor: \"#03a9f4\" },\n\t * ]\n\t */\n\tthresholds?: ThresholdOptions[]\n\t/**\n\t * tick configuration\n\t */\n\tticks?: {\n\t\t/**\n\t\t * number of ticks to show\n\t\t */\n\t\tnumber?: number\n\t\t/**\n\t\t * minimum tick value\n\t\t */\n\t\tmin?: number\n\t\t/**\n\t\t * maximum tick value\n\t\t */\n\t\tmax?: number\n\t\t/**\n\t\t * minimum width of a tick\n\t\t * before getting rotated (in pixels)\n\t\t */\n\t\trotateIfSmallerThan?: number\n\t\t/**\n\t\t * when to rotate ticks\n\t\t */\n\t\trotation?: TickRotations\n\t\t/**\n\t\t * function to format the ticks\n\t\t */\n\t\tformatter?: (tick: number | Date, i: number) => string\n\t\t/**\n\t\t * optional custom array of tick values that is within the domain of data\n\t\t */\n\t\tvalues?: any[]\n\t}\n\ttruncation?: TruncationOptions\n\t/**\n\t * is axis visible or not\n\t */\n\tvisible?: boolean\n\t/**\n\t * Bins to display (Histogram)\n\t * bins: 20\n\t * bins: [0, 20, 40, 60]\n\t * bins: [new Date(...), new Date(...), ...]\n\t */\n\tbins?: number | any[]\n\t/**\n\t * limit the visible axis domain to only the binned area\n\t */\n\tlimitDomainToBins?: boolean\n\t/**\n\t * should be set to `true` on the domain\n\t * axis that's being broken into bins\n\t */\n\tbinned?: boolean\n}\n\n/**\n * options to configure a scale. not all options are used by all scales\n */\nexport interface AxisOptions extends BasedAxisOptions {\n\t/**\n\t * option for stacked axis\n\t */\n\tstacked?: boolean\n\t/**\n\t * option for percentage axis scale\n\t */\n\tpercentage?: boolean\n}\n\nexport interface ComboChartAxisOptions extends AxisOptions {\n\t/**\n\t * should be set to `true` for the\n\t * left axis to be the primary axis\n\t */\n\tmain?: boolean\n\t/**\n\t * used to map data on the secondary axis\n\t */\n\tcorrespondingDatasets?: Array\n}\n\nexport interface BinnedAxisOptions {\n\t/**\n\t * should be set to `true` on the domain\n\t * axis that's being broken into bins\n\t */\n\tbinned?: boolean\n\t/**\n\t * Bins to display (Histogram)\n\t * bins: 20\n\t * bins: [0, 20, 40, 60]\n\t * bins: [new Date(...), new Date(...), ...]\n\t */\n\tbins?: number | any[]\n\t/**\n\t * limit the visible axis domain to only the binned area\n\t */\n\tlimitDomainToBins?: boolean\n}\n\n/**\n * customize time series scales\n */\nexport interface TimeScaleOptions {\n\taddSpaceOnEdges?: number\n\t/**\n\t * if it's true, days are shown as mon-sun,\n\t * otherwise days are shown as number 1-31\n\t */\n\tshowDayName?: boolean\n\t/**\n\t * this can be used to override the time interval\n\t * that's chosen by the library\n\t */\n\ttimeInterval?: TimeIntervalNames\n\t/**\n\t * formats for each time interval\n\t */\n\ttimeIntervalFormats?: TimeIntervalFormats\n\t/**\n\t * locale object, for more information see https://date-fns.org/v2.11.0/docs/Locale.\n\t * example: `import { fr as localeObject } from 'date-fns/locale'`.\n\t * available locale objects are: https://github.com/date-fns/date-fns/tree/master/src/locale\n\t */\n\tlocaleObject?: Locale\n}\n\n/**\n * time scales: customize ticks format for different time intervals\n */\nexport interface TickFormats {\n\tprimary?: string\n\tsecondary?: string\n}\n\nexport enum TimeIntervalNames {\n\t'15seconds' = '15seconds',\n\tminute = 'minute',\n\t'30minutes' = '30minutes',\n\thourly = 'hourly',\n\tdaily = 'daily',\n\tweekly = 'weekly',\n\tmonthly = 'monthly',\n\tquarterly = 'quarterly',\n\tyearly = 'yearly'\n}\n\nexport interface TimeIntervalFormats {\n\t'15seconds'?: TickFormats\n\tminute?: TickFormats\n\t'30minutes'?: TickFormats\n\thourly?: TickFormats\n\tdaily?: TickFormats\n\tweekly?: TickFormats\n\tmonthly?: TickFormats\n\tquarterly?: TickFormats\n\tyearly?: TickFormats\n}\n\n/**\n * customize the axes components\n */\nexport interface AxesOptions {\n\tleft?: AxesOptionType\n\tbottom?: AxesOptionType\n\tright?: AxesOptionType\n\ttop?: AxesOptionType\n}\n","import { min } from 'd3'\nimport { format } from 'date-fns/format'\n\nimport { getProperty } from '@/tools'\nimport { TimeIntervalFormats, TimeIntervalNames, TimeScaleOptions } from '@/interfaces/axis-scales'\n\nexport const TIME_INTERVALS = [\n\t['15seconds', 15 * 1000],\n\t['minute', 60 * 1000],\n\t['30minutes', 30 * 60 * 1000],\n\t['hourly', 60 * 60 * 1000],\n\t['daily', 24 * 60 * 60 * 1000],\n\t['monthly', 30 * 24 * 60 * 60 * 1000],\n\t['quarterly', 3 * 30 * 24 * 60 * 60 * 1000],\n\t['yearly', 12 * 30 * 24 * 60 * 60 * 1000]\n]\n\n// Return true if the tick is a primary tick, false otherwise\nexport function isTickPrimary(\n\ttick: number,\n\ti: number,\n\tallTicks: Array,\n\tinterval: string,\n\tshowDayName: boolean\n): boolean {\n\tconst isFirstTick = i === 0\n\tconst hasANewWeekStarted = Number(format(new Date(tick), 'c')) === 2\n\tconst isFirstQuarter = Number(format(new Date(tick), 'q')) === 1\n\tconst previousTick = i !== 0 ? allTicks[i - 1] : null\n\n\tswitch (interval) {\n\t\tcase '15seconds':\n\t\t\treturn (\n\t\t\t\tisFirstTick ||\n\t\t\t\tisDayOfMonthChanged(tick) ||\n\t\t\t\tisMonthChanged(tick, previousTick) ||\n\t\t\t\tisYearChanged(tick)\n\t\t\t)\n\t\tcase 'minute':\n\t\t\treturn (\n\t\t\t\tisFirstTick ||\n\t\t\t\tisDayOfMonthChanged(tick) ||\n\t\t\t\tisMonthChanged(tick, previousTick) ||\n\t\t\t\tisYearChanged(tick)\n\t\t\t)\n\t\tcase '30minutes':\n\t\t\treturn (\n\t\t\t\tisFirstTick ||\n\t\t\t\tisDayOfMonthChanged(tick) ||\n\t\t\t\tisMonthChanged(tick, previousTick) ||\n\t\t\t\tisYearChanged(tick)\n\t\t\t)\n\t\tcase 'hourly':\n\t\t\treturn (\n\t\t\t\tisFirstTick ||\n\t\t\t\tisDayOfMonthChanged(tick) ||\n\t\t\t\tisMonthChanged(tick, previousTick) ||\n\t\t\t\tisYearChanged(tick)\n\t\t\t)\n\t\tcase 'daily':\n\t\t\tif (!showDayName) {\n\t\t\t\t// daily\n\t\t\t\treturn isFirstTick || isMonthChanged(tick, previousTick) || isYearChanged(tick)\n\t\t\t} else {\n\t\t\t\t// weekly\n\t\t\t\treturn isFirstTick || hasANewWeekStarted || isYearChanged(tick)\n\t\t\t}\n\t\tcase 'weekly':\n\t\t\treturn isFirstTick || hasANewWeekStarted || isYearChanged(tick)\n\t\tcase 'monthly':\n\t\t\treturn isFirstTick || isYearChanged(tick)\n\t\tcase 'quarterly':\n\t\t\treturn isFirstTick || isFirstQuarter\n\t\tcase 'yearly':\n\t\t\treturn false\n\t\tdefault:\n\t\t\tthrow new Error(`${interval} is not a valid time interval.`)\n\t}\n}\n\n// Return the formatted current tick\nexport function formatTick(\n\ttick: number,\n\ti: number,\n\tallTicks: Array,\n\tinterval: string,\n\ttimeScaleOptions: TimeScaleOptions\n): string {\n\tconst showDayName = timeScaleOptions.showDayName\n\tconst intervalConsideringAlsoShowDayNameOption =\n\t\tinterval === 'daily' && showDayName ? 'weekly' : interval\n\tconst date = new Date(tick)\n\tconst formats = getProperty(timeScaleOptions, 'timeIntervalFormats')[\n\t\tintervalConsideringAlsoShowDayNameOption\n\t]\n\tconst primary = getProperty(formats, 'primary')\n\tconst secondary = getProperty(formats, 'secondary')\n\tlet formatString = isTickPrimary(tick, i, allTicks, interval, showDayName) ? primary : secondary\n\n\t// if the interval, and the timestamp includes milliseconds value\n\tif (interval === '15seconds' && date.getMilliseconds() !== 0) {\n\t\t// show milliseconds in tick\n\t\tformatString = formatString.replace('pp', 'h:mm:ss.SSS a')\n\t}\n\n\tconst locale = timeScaleOptions.localeObject\n\n\treturn format(date, formatString, { locale })\n}\n\n// Given a timestamp, return an object of useful time formats\n// Use Unicode date field symbol (https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table)\nexport function getTimeformats(timestamp: number) {\n\tconst date = new Date(timestamp)\n\treturn {\n\t\tM: date.getMonth() + 1, // month: 1-12\n\t\td: date.getDate(), // day of the month: 1-31\n\t\tH: date.getHours(), // 24-hour clock: 0-23\n\t\tm: date.getMinutes(), // minute: 0-59\n\t\ts: date.getSeconds() // seconds: 0-59\n\t}\n}\n\n// Find the differences between consecutive numbers in an array\nfunction getConsecutiveDifferences(elements: number[]): number[] {\n\tif (!elements) {\n\t\treturn\n\t}\n\treturn elements.slice(1).map((elem, i) => elem - elements[i])\n}\n\n// Given a duration in ms, return the closest TIME_INTERVAL name\nfunction closestTimeIntervalName(duration: number): string {\n\tconst index = TIME_INTERVALS.reduce((nearestIndex, [, delta]: [string, number], i) => {\n\t\tconst deltaNearest = TIME_INTERVALS[nearestIndex][1] as number\n\t\tconst oldNearestSpan = Math.abs(deltaNearest - duration)\n\t\tconst currentSpan = Math.abs(delta - duration)\n\t\treturn oldNearestSpan < currentSpan ? nearestIndex : i\n\t}, 0)\n\treturn TIME_INTERVALS[index][0] as string\n}\n\n// Given an array of timestamps, return the interval name\n// between 15seconds, minute, 30minutes, hourly, daily, weekly, monthly, quarterly, yearly\nexport function computeTimeIntervalName(\n\tticks: number[],\n\tintervalOverride?: keyof TimeIntervalFormats\n): string {\n\tif (TimeIntervalNames[intervalOverride]) {\n\t\treturn intervalOverride\n\t}\n\n\t// special case: if the dataset has only one datum, we show the tick in the most detailed way possible\n\tif (ticks.length === 1) {\n\t\treturn '15seconds'\n\t}\n\tconst differences = getConsecutiveDifferences(ticks)\n\tconst minDifference = min(differences)\n\treturn closestTimeIntervalName(minDifference)\n}\n\n// Return true if the day of the month (D = 1-31) is changed, false otherwise\nfunction isDayOfMonthChanged(timestamp: number): boolean {\n\tconst { s, m, H } = getTimeformats(timestamp)\n\treturn H === 0 && m === 0 && s === 0\n}\n\n// Return true if the month (M = 1-12) is changed from previous tick's timestamp, false otherwise\nfunction isMonthChanged(timestamp: number, previousTimestamp?: number): boolean {\n\tconst currentMonth = getTimeformats(timestamp).M\n\tconst previousMonth = getTimeformats(previousTimestamp).M\n\treturn currentMonth !== previousMonth\n}\n\n// Return true if the year (YYYY) is changed, false otherwise\nfunction isYearChanged(timestamp: number): boolean {\n\tconst { M, d, s, m, H } = getTimeformats(timestamp)\n\treturn M === 1 && d === 1 && H === 0 && m === 0 && s === 0\n}\n\n// Return string value of Date with milliseconds\nexport function formatDateTillMilliSeconds(date: Date) {\n\tif (date === undefined) {\n\t\treturn ''\n\t}\n\n\t// The only valid format with millisecond is ISO 8601\n\treturn date.toISOString()\n}\n","import { format } from 'date-fns'\nimport { bin as d3Bin, scaleOrdinal, stack, stackOffsetDiverging } from 'd3'\nimport { cloneDeep, fromPairs, groupBy, merge, uniq } from 'lodash-es'\nimport { getProperty, updateLegendAdditionalItems } from '@/tools'\nimport { color as colorConfigs, legend as legendConfigs } from '@/configuration'\nimport { histogram as histogramConfigs } from '@/configuration-non-customizable'\nimport { Events, ScaleTypes, ColorClassNameTypes } from '@/interfaces/enums'\nimport { formatDateTillMilliSeconds } from '@/services/time-series'\nimport type { ChartTabularData } from '@/interfaces/model'\n\nexport type StackKeysParams = {\n\tbins?: any\n\tgroups?: any\n\tpercentage?: any\n\tdivergent?: any\n}\n\nfunction _sanitizeCsvCell(cellContent: string): string {\n\tconst _trimmedCell = cellContent.trim()\n\tif (['=', '+', '-', '@', '\\t', '\\r'].includes(_trimmedCell.charAt(0))) {\n\t\treturn `\\xA0${_trimmedCell}`\n\t}\n\n\t// Only add quotes if cell contains commas, newlines, or quotes\n\tif (/[,\\\"\\n]/.test(_trimmedCell)) {\n\t\treturn `\"${_trimmedCell}\"`\n\t}\n\n\treturn _trimmedCell\n}\n\n/** The charting model layer which includes mainly the chart data and options,\n * as well as some misc. information to be shared among components */\nexport class ChartModel {\n\tprotected services: any\n\n\t// Internal Model state\n\tprotected state: any = {\n\t\toptions: {}\n\t}\n\n\t// Data labels\n\t/**\n\t * A list of all the data groups that have existed within the lifetime of the chart\n\t * @type string[]\n\t */\n\tprotected allDataGroups: string[]\n\n\t// Fill scales & fill related objects\n\tprotected colorScale: any = {}\n\n\tprotected colorClassNames: any = {}\n\n\tconstructor(services: any) {\n\t\tthis.services = services\n\t}\n\n\tformatTable({ headers, cells }) {\n\t\tconst options = this.getOptions()\n\t\tconst tableHeadingFormatter = getProperty(options, 'tabularRepModal', 'tableHeadingFormatter')\n\t\tconst tableCellFormatter = getProperty(options, 'tabularRepModal', 'tableCellFormatter')\n\t\tconst { cartesianScales } = this.services\n\t\tconst domainScaleType = cartesianScales?.getDomainAxisScaleType()\n\t\tlet domainValueFormatter: any\n\n\t\tif (domainScaleType === ScaleTypes.TIME) {\n\t\t\tdomainValueFormatter = (d: any) => format(d, 'MMM d, yyyy')\n\t\t}\n\t\tconst result = [\n\t\t\ttypeof tableHeadingFormatter === 'function' ? tableHeadingFormatter(headers) : headers,\n\t\t\t...(typeof tableCellFormatter === 'function'\n\t\t\t\t? tableCellFormatter(cells)\n\t\t\t\t: cells.map((data: (string | number)[]) => {\n\t\t\t\t\t\tif (domainValueFormatter) {\n\t\t\t\t\t\t\tdata[1] = domainValueFormatter(data[1]) as string\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn data\n\t\t\t\t\t}))\n\t\t]\n\t\treturn result\n\t}\n\n\tgetAllDataFromDomain(groups?: any) {\n\t\tif (!this.getData()) {\n\t\t\treturn null\n\t\t}\n\t\tconst options = this.getOptions()\n\t\t// Remove datasets that have been disabled\n\t\tlet allData = this.getData()\n\t\tconst dataGroups = this.getDataGroups()\n\t\tconst { groupMapsTo } = getProperty(options, 'data')\n\t\tconst axesOptions = getProperty(options, 'axes')\n\n\t\t// filter out the groups that are irrelevant to the component\n\t\tif (groups) {\n\t\t\tallData = allData.filter((item: any) => groups.includes(item[groupMapsTo]))\n\t\t}\n\n\t\tif (axesOptions) {\n\t\t\tObject.keys(axesOptions).forEach(axis => {\n\t\t\t\tconst mapsTo = axesOptions[axis].mapsTo\n\t\t\t\tconst scaleType = axesOptions[axis].scaleType\n\t\t\t\t// make sure linear/log values are numbers\n\t\t\t\tif (scaleType === ScaleTypes.LINEAR || scaleType === ScaleTypes.LOG) {\n\t\t\t\t\tallData = allData.map((datum: any) => {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...datum,\n\t\t\t\t\t\t\t[mapsTo]: datum[mapsTo] === null ? datum[mapsTo] : Number(datum[mapsTo])\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\t// Check for custom domain\n\t\t\t\tif (mapsTo && axesOptions[axis].domain) {\n\t\t\t\t\tif (scaleType === ScaleTypes.LABELS) {\n\t\t\t\t\t\tallData = allData.filter((datum: any) =>\n\t\t\t\t\t\t\taxesOptions[axis].domain.includes(datum[mapsTo])\n\t\t\t\t\t\t)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst [start, end] = axesOptions[axis].domain\n\t\t\t\t\t\t// Filter out data outside domain if that datapoint is using that axis (has mapsTo property)\n\t\t\t\t\t\tallData = allData.filter(\n\t\t\t\t\t\t\t(datum: any) => !(mapsTo in datum) || (datum[mapsTo] >= start && datum[mapsTo] <= end)\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\treturn allData.filter((datum: any) => {\n\t\t\treturn dataGroups.find((group: any) => group.name === datum[groupMapsTo])\n\t\t})\n\t}\n\n\t/**\n\t * Charts that have group configs passed into them, only want to retrieve the display data relevant to that chart\n\t * @param groups the included datasets for the particular chart\n\t */\n\tgetDisplayData(groups?: any) {\n\t\tif (!this.get('data')) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst { ACTIVE } = legendConfigs.items.status\n\t\tconst dataGroups = this.getDataGroups(groups)\n\t\tconst { groupMapsTo } = this.getOptions().data\n\t\tconst allDataFromDomain = this.getAllDataFromDomain(groups)\n\n\t\treturn allDataFromDomain.filter((datum: any) => {\n\t\t\treturn dataGroups.find(\n\t\t\t\t(dataGroup: any) => dataGroup.name === datum[groupMapsTo] && dataGroup.status === ACTIVE\n\t\t\t)\n\t\t})\n\t}\n\n\tgetData() {\n\t\treturn this.get('data')\n\t}\n\n\tisDataEmpty() {\n\t\treturn !this.getData().length\n\t}\n\n\t/**\n\t *\n\t * @param newData The new raw data to be set\n\t */\n\tsetData(newData: any) {\n\t\tconst sanitizedData = this.sanitize(cloneDeep(newData))\n\t\tconst dataGroups = this.generateDataGroups(sanitizedData)\n\n\t\tthis.set({\n\t\t\tdata: sanitizedData,\n\t\t\tdataGroups\n\t\t})\n\n\t\treturn sanitizedData\n\t}\n\n\tgetDataGroups(groups?: any) {\n\t\tconst isDataLoading = getProperty(this.getOptions(), 'data', 'loading')\n\n\t\t// No data should be displayed while data is still loading\n\t\tif (isDataLoading) {\n\t\t\treturn []\n\t\t}\n\n\t\t// if its a combo chart, the specific chart will pass the model the groups it needs\n\t\tif (groups) {\n\t\t\treturn this.get('dataGroups').filter((dataGroup: any) => groups.includes(dataGroup.name))\n\t\t}\n\t\treturn this.get('dataGroups')\n\t}\n\n\tgetActiveDataGroups(groups?: any) {\n\t\tconst { ACTIVE } = legendConfigs.items.status\n\n\t\treturn this.getDataGroups(groups).filter((dataGroup: any) => dataGroup.status === ACTIVE)\n\t}\n\n\tgetDataGroupNames(groups?: any) {\n\t\tconst dataGroups = this.getDataGroups(groups)\n\t\treturn dataGroups.map((dataGroup: any) => dataGroup.name)\n\t}\n\n\tgetActiveDataGroupNames(groups?: any) {\n\t\tconst activeDataGroups = this.getActiveDataGroups(groups)\n\t\treturn activeDataGroups.map((dataGroup: any) => dataGroup.name)\n\t}\n\n\tprivate aggregateBinDataByGroup(bin: any) {\n\t\treturn groupBy(bin, 'group')\n\t}\n\n\tgetBinConfigurations() {\n\t\t// Manipulate data and options for Histogram\n\t\tconst data = this.getDisplayData()\n\t\tconst options = this.getOptions()\n\n\t\tconst mainXPos = this.services.cartesianScales.getMainXAxisPosition()\n\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier()\n\n\t\tconst axisOptions = options.axes[mainXPos]\n\t\tconst { groupMapsTo } = options.data\n\t\tconst { bins: axisBins = histogramConfigs.defaultBins } = axisOptions\n\t\tconst areBinsDefined = Array.isArray(axisBins)\n\n\t\t// Get Histogram bins\n\t\tconst bins = d3Bin()\n\t\t\t.value((d: any) => d[domainIdentifier])\n\t\t\t.thresholds(axisBins)(data)\n\n\t\tif (!areBinsDefined) {\n\t\t\t// If bins are not defined by user\n\t\t\tconst binsWidth = bins[0].x1 - bins[0].x0\n\t\t\t// Set last bin width as the others\n\t\t\tbins[bins.length - 1].x1 = +bins[bins.length - 1].x0 + binsWidth\n\t\t} else {\n\t\t\t// Set last bin end as the last user defined one\n\t\t\tbins[bins.length - 1].x1 = axisBins[axisBins.length - 1]\n\t\t}\n\n\t\tconst binsDomain = areBinsDefined\n\t\t\t? [axisBins[0], axisBins[axisBins.length - 1]]\n\t\t\t: [bins[0].x0, bins[bins.length - 1].x1]\n\n\t\t// Get all groups\n\t\tconst groupsKeys = Array.from(new Set(data.map((d: any) => d[groupMapsTo])))\n\n\t\tconst histogramData = []\n\n\t\t// Group data by bin\n\t\tbins.forEach(bin => {\n\t\t\tconst key = `${bin.x0}-${bin.x1}`\n\t\t\tconst aggregateDataByGroup = this.aggregateBinDataByGroup(bin)\n\n\t\t\tgroupsKeys.forEach((group: string) => {\n\t\t\t\t// For each dataset put a bin with value 0 if not exist\n\t\t\t\t// (Scale X won't change when changing showed datasets)\n\t\t\t\thistogramData.push({\n\t\t\t\t\tgroup,\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue: aggregateDataByGroup[group] || 0,\n\t\t\t\t\tbin: bin.x0\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\n\t\treturn {\n\t\t\tbins,\n\t\t\tbinsDomain\n\t\t}\n\t}\n\n\tgetBinnedStackedData() {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst dataGroupNames = this.getActiveDataGroupNames()\n\n\t\tconst { bins } = this.getBinConfigurations()\n\t\tconst dataValuesGroupedByKeys = this.getDataValuesGroupedByKeys({\n\t\t\tbins\n\t\t})\n\n\t\treturn stack()\n\t\t\t.keys(dataGroupNames)(dataValuesGroupedByKeys)\n\t\t\t.map((series, i) => {\n\t\t\t\t// Add data group names to each series\n\t\t\t\treturn Object.keys(series)\n\t\t\t\t\t.filter((key: any) => !isNaN(key))\n\t\t\t\t\t.map((key: any) => {\n\t\t\t\t\t\tconst element = series[key]\n\t\t\t\t\t\telement[groupMapsTo] = dataGroupNames[i]\n\n\t\t\t\t\t\treturn element\n\t\t\t\t\t})\n\t\t\t})\n\t}\n\n\tgetGroupedData(groups?: any) {\n\t\tconst displayData = this.getDisplayData(groups)\n\t\tconst groupedData: any = {}\n\t\tconst { groupMapsTo } = this.getOptions().data\n\n\t\tdisplayData.map((datum: any) => {\n\t\t\tconst group = datum[groupMapsTo]\n\t\t\tif (groupedData[group] !== null && groupedData[group] !== undefined) {\n\t\t\t\tgroupedData[group].push(datum)\n\t\t\t} else {\n\t\t\t\tgroupedData[group] = [datum]\n\t\t\t}\n\t\t})\n\n\t\treturn Object.keys(groupedData).map(groupName => ({\n\t\t\tname: groupName,\n\t\t\tdata: groupedData[groupName]\n\t\t}))\n\t}\n\n\tgetStackKeys({ bins = null, groups = null }: StackKeysParams = { bins: null, groups: null }) {\n\t\tconst options = this.getOptions()\n\n\t\tconst displayData = this.getDisplayData(groups)\n\n\t\tlet stackKeys: any\n\t\tif (bins) {\n\t\t\tstackKeys = bins.map((bin: any) => `${bin.x0}:${bin.x1}`)\n\t\t} else {\n\t\t\tstackKeys = uniq(\n\t\t\t\tdisplayData.map((datum: any) => {\n\t\t\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(datum)\n\n\t\t\t\t\t// Use time value as key for Date object to avoid multiple data in the same second\n\t\t\t\t\tif (datum[domainIdentifier] instanceof Date) {\n\t\t\t\t\t\treturn formatDateTillMilliSeconds(datum[domainIdentifier])\n\t\t\t\t\t}\n\n\t\t\t\t\treturn datum[domainIdentifier] && typeof datum[domainIdentifier].toString === 'function'\n\t\t\t\t\t\t? datum[domainIdentifier].toString()\n\t\t\t\t\t\t: datum[domainIdentifier]\n\t\t\t\t})\n\t\t\t)\n\t\t}\n\n\t\tconst axisPosition = this.services.cartesianScales.domainAxisPosition\n\t\tconst scaleType = options.axes[axisPosition].scaleType\n\n\t\t// Sort keys\n\t\tif (scaleType === ScaleTypes.TIME) {\n\t\t\tstackKeys.sort((a: any, b: any) => {\n\t\t\t\tconst dateA: any = new Date(a)\n\t\t\t\tconst dateB: any = new Date(b)\n\n\t\t\t\treturn dateA - dateB\n\t\t\t})\n\t\t} else if (scaleType === ScaleTypes.LOG || scaleType === ScaleTypes.LINEAR) {\n\t\t\tstackKeys.sort((a: any, b: any) => a - b)\n\t\t}\n\n\t\treturn stackKeys\n\t}\n\n\tgetDataValuesGroupedByKeys({ bins = null, groups = null }: StackKeysParams) {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst displayData = this.getDisplayData(groups)\n\n\t\tconst dataGroupNames = this.getDataGroupNames()\n\n\t\tconst stackKeys = this.getStackKeys({ bins, groups })\n\t\tif (bins) {\n\t\t\treturn stackKeys.map((key: any) => {\n\t\t\t\tconst [binStart, binEnd] = key.split(':')\n\n\t\t\t\tconst correspondingValues: any = { x0: binStart, x1: binEnd }\n\t\t\t\tconst correspondingBin = bins.find((bin: any) => bin.x0.toString() === binStart.toString())\n\t\t\t\tdataGroupNames.forEach((dataGroupName: any) => {\n\t\t\t\t\tcorrespondingValues[dataGroupName] = correspondingBin.filter(\n\t\t\t\t\t\t(binItem: any) => binItem[groupMapsTo] === dataGroupName\n\t\t\t\t\t).length\n\t\t\t\t})\n\n\t\t\t\treturn correspondingValues\n\t\t\t}) as any\n\t\t}\n\n\t\treturn stackKeys.map((key: any) => {\n\t\t\tconst correspondingValues: any = { sharedStackKey: key }\n\t\t\tdataGroupNames.forEach((dataGroupName: any) => {\n\t\t\t\tconst correspondingDatum = displayData.find((datum: any) => {\n\t\t\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(datum)\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\tdatum[groupMapsTo] === dataGroupName &&\n\t\t\t\t\t\tObject.prototype.hasOwnProperty.call(datum, domainIdentifier) &&\n\t\t\t\t\t\t(datum[domainIdentifier] instanceof Date\n\t\t\t\t\t\t\t? formatDateTillMilliSeconds(datum[domainIdentifier]) === key\n\t\t\t\t\t\t\t: datum[domainIdentifier].toString() === key)\n\t\t\t\t\t)\n\t\t\t\t})\n\n\t\t\t\tconst rangeIdentifier =\n\t\t\t\t\tthis.services.cartesianScales.getRangeIdentifier(correspondingValues)\n\t\t\t\tcorrespondingValues[dataGroupName] = correspondingDatum\n\t\t\t\t\t? correspondingDatum[rangeIdentifier]\n\t\t\t\t\t: null\n\t\t\t})\n\n\t\t\treturn correspondingValues\n\t\t}) as any\n\t}\n\n\tgetStackedData({ percentage = false, groups = null, divergent = false }: StackKeysParams) {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\t// Get only active data groups so non-active data groups are not rendered\n\t\t// on legend item click\n\t\tconst dataGroupNames = this.getActiveDataGroupNames(groups)\n\t\tconst dataValuesGroupedByKeys = this.getDataValuesGroupedByKeys({\n\t\t\tgroups\n\t\t})\n\n\t\tif (percentage) {\n\t\t\tconst maxByKey = fromPairs(dataValuesGroupedByKeys.map((d: any) => [d.sharedStackKey, 0]))\n\n\t\t\tdataValuesGroupedByKeys.forEach((d: any) => {\n\t\t\t\tdataGroupNames.forEach((name: any) => {\n\t\t\t\t\tmaxByKey[d.sharedStackKey] += d[name]\n\t\t\t\t})\n\t\t\t})\n\n\t\t\t// cycle through data values to get percentage\n\t\t\tdataValuesGroupedByKeys.forEach((d: any) => {\n\t\t\t\tdataGroupNames.forEach((name: any) => {\n\t\t\t\t\tconst denominator: number = maxByKey[d.sharedStackKey] as number\n\t\t\t\t\tif (maxByKey[d.sharedStackKey]) {\n\t\t\t\t\t\td[name] = (d[name] / denominator) * 100\n\t\t\t\t\t} else {\n\t\t\t\t\t\td[name] = 0\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t\t}\n\n\t\tconst stackToUse = divergent ? stack().offset(stackOffsetDiverging) : stack()\n\n\t\treturn stackToUse\n\t\t\t.keys(dataGroupNames)(dataValuesGroupedByKeys)\n\t\t\t.map((series: any, i: number) => {\n\t\t\t\t// Add data group names to each series\n\t\t\t\treturn Object.keys(series)\n\t\t\t\t\t.filter((key: any) => !isNaN(key))\n\t\t\t\t\t.map((key: any) => {\n\t\t\t\t\t\tconst element = series[key]\n\t\t\t\t\t\telement[groupMapsTo] = dataGroupNames[i]\n\n\t\t\t\t\t\treturn element\n\t\t\t\t\t})\n\t\t\t})\n\t}\n\n\t/**\n\t * @return {Object} The chart's options\n\t */\n\tgetOptions() {\n\t\treturn this.state.options\n\t}\n\n\tset(newState: any, configs?: any) {\n\t\tthis.state = Object.assign({}, this.state, newState)\n\t\tconst newConfig = Object.assign(\n\t\t\t{ skipUpdate: false, animate: true }, // default configs\n\t\t\tconfigs\n\t\t)\n\t\tif (!newConfig.skipUpdate) {\n\t\t\tthis.update(newConfig.animate)\n\t\t}\n\t}\n\n\tget(property?: string) {\n\t\tif (property) {\n\t\t\treturn this.state[property]\n\t\t} else {\n\t\t\treturn this.state\n\t\t}\n\t}\n\n\t/**\n\t *\n\t * @param newOptions New options to be set\n\t */\n\tsetOptions(newOptions: any) {\n\t\tconst options = this.getOptions()\n\t\tupdateLegendAdditionalItems(options, newOptions)\n\n\t\tthis.set({\n\t\t\toptions: merge(options, newOptions)\n\t\t})\n\t}\n\n\t/**\n\t *\n\t * Updates miscellanous information within the model\n\t * such as the color scales, or the legend data labels\n\t */\n\tupdate(animate = true) {\n\t\tif (!this.getDisplayData()) {\n\t\t\treturn\n\t\t}\n\n\t\tthis.updateAllDataGroups()\n\n\t\tthis.setCustomColorScale()\n\t\tthis.setColorClassNames()\n\t\tthis.services.events.dispatchEvent(Events.Model.UPDATE, { animate })\n\t}\n\n\t/*\n\t * Data labels\n\t */\n\ttoggleDataLabel(changedLabel: string) {\n\t\tconst { ACTIVE, DISABLED } = legendConfigs.items.status\n\t\tconst dataGroups = this.getDataGroups()\n\n\t\tconst hasDeactivatedItems = dataGroups.some((group: any) => group.status === DISABLED)\n\t\tconst activeItems = dataGroups.filter((group: any) => group.status === ACTIVE)\n\n\t\t// If there are deactivated items, toggle \"changedLabel\"\n\t\tif (hasDeactivatedItems) {\n\t\t\t// If the only active item is being toggled\n\t\t\t// Activate all items\n\t\t\tif (activeItems.length === 1 && activeItems[0].name === changedLabel) {\n\t\t\t\t// If every item is active, then enable \"changedLabel\" and disable all other items\n\t\t\t\tdataGroups.forEach((_: any, i: number) => {\n\t\t\t\t\tdataGroups[i].status = ACTIVE\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tconst indexToChange = dataGroups.findIndex((group: any) => group.name === changedLabel)\n\t\t\t\tdataGroups[indexToChange].status =\n\t\t\t\t\tdataGroups[indexToChange].status === DISABLED ? ACTIVE : DISABLED\n\t\t\t}\n\t\t} else {\n\t\t\t// If every item is active, then enable \"changedLabel\" and disable all other items\n\t\t\tdataGroups.forEach((group: any, i: number) => {\n\t\t\t\tdataGroups[i].status = group.name === changedLabel ? ACTIVE : DISABLED\n\t\t\t})\n\t\t}\n\n\t\t// Updates selected groups\n\t\tconst updatedActiveItems = dataGroups.filter((group: any) => group.status === ACTIVE)\n\t\tconst options = this.getOptions()\n\n\t\tconst hasUpdatedDeactivatedItems = dataGroups.some((group: any) => group.status === DISABLED)\n\n\t\t// If there are deactivated items, map the item name into selected groups\n\t\tif (hasUpdatedDeactivatedItems) {\n\t\t\toptions.data.selectedGroups = updatedActiveItems.map((activeItem: any) => activeItem.name)\n\t\t} else {\n\t\t\t// If every item is active, clear array\n\t\t\toptions.data.selectedGroups = []\n\t\t}\n\n\t\t// dispatch legend filtering event with the status of all the dataLabels\n\t\tthis.services.events.dispatchEvent(Events.Legend.ITEMS_UPDATE, {\n\t\t\tdataGroups\n\t\t})\n\n\t\t// Update model\n\t\tthis.set({\n\t\t\tdataGroups\n\t\t})\n\t}\n\n\t/**\n\t * Should the data point be filled?\n\t * @param group\n\t * @param key\n\t * @param data\n\t * @param defaultFilled the default for this chart\n\t */\n\tgetIsFilled(group: any, key?: any, data?: any, defaultFilled?: boolean) {\n\t\tconst options = this.getOptions()\n\t\tif (options.getIsFilled) {\n\t\t\treturn options.getIsFilled(group, key, data, defaultFilled)\n\t\t} else {\n\t\t\treturn defaultFilled\n\t\t}\n\t}\n\n\tgetFillColor(group: any, key?: any, data?: any) {\n\t\tconst options = this.getOptions()\n\t\tconst defaultFillColor = getProperty(this.colorScale, group)\n\n\t\tif (options.getFillColor) {\n\t\t\treturn options.getFillColor(group, key, data, defaultFillColor)\n\t\t} else {\n\t\t\treturn defaultFillColor\n\t\t}\n\t}\n\n\tgetStrokeColor(group: any, key?: any, data?: any) {\n\t\tconst options = this.getOptions()\n\t\tconst defaultStrokeColor = getProperty(this.colorScale, group)\n\n\t\tif (options.getStrokeColor) {\n\t\t\treturn options.getStrokeColor(group, key, data, defaultStrokeColor)\n\t\t} else {\n\t\t\treturn defaultStrokeColor\n\t\t}\n\t}\n\n\tisUserProvidedColorScaleValid() {\n\t\tconst userProvidedScale = getProperty(this.getOptions(), 'color', 'scale')\n\t\tconst dataGroups = this.getDataGroups()\n\n\t\tif (userProvidedScale == null || Object.keys(userProvidedScale).length == 0) {\n\t\t\treturn false\n\t\t}\n\n\t\treturn dataGroups.some((dataGroup: any) =>\n\t\t\tObject.keys(userProvidedScale).includes(dataGroup.name)\n\t\t)\n\t}\n\n\tgetColorClassName(configs: {\n\t\tclassNameTypes?: ColorClassNameTypes[] // heatmaps do not pass this value\n\t\tdataGroupName?: string | number\n\t\toriginalClassName?: string\n\t\tvalue?: number // required for heatmap override\n\t}) {\n\t\tconst colorPairingTag = this.colorClassNames(configs.dataGroupName)\n\t\tlet className = configs.originalClassName\n\t\tconfigs.classNameTypes.forEach(\n\t\t\ttype =>\n\t\t\t\t(className = configs.originalClassName\n\t\t\t\t\t? `${className} ${type}-${colorPairingTag}`\n\t\t\t\t\t: `${type}-${colorPairingTag}`)\n\t\t)\n\n\t\treturn className || ''\n\t}\n\n\t/**\n\t * For charts that might hold an associated status for their dataset\n\t */\n\tgetStatus(): any {\n\t\treturn null\n\t}\n\n\tgetAllDataGroupsNames() {\n\t\treturn this.allDataGroups\n\t}\n\n\t/**\n\t * Converts data provided in the older format to tabular\n\t *\n\t */\n\tprotected transformToTabularData(data: any) {\n\t\tconsole.warn(\n\t\t\t\"We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://charts.carbondesignsystem.com/?path=/story/docs-tutorials--tabular-data-format\"\n\t\t)\n\t\tconst tabularData: ChartTabularData = []\n\t\tconst { datasets, labels } = data\n\n\t\t// Loop through all datasets\n\t\tdatasets.forEach((dataset: any) => {\n\t\t\t// Update each data point to the new format\n\t\t\tdataset.data.forEach((datum: any, i: number) => {\n\t\t\t\tlet group\n\n\t\t\t\tconst datasetLabel = getProperty(dataset, 'label')\n\t\t\t\tif (datasetLabel === null) {\n\t\t\t\t\tconst correspondingLabel = getProperty(labels, i)\n\t\t\t\t\tif (correspondingLabel) {\n\t\t\t\t\t\tgroup = correspondingLabel\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgroup = 'Ungrouped'\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tgroup = datasetLabel\n\t\t\t\t}\n\n\t\t\t\tconst updatedDatum: any = {\n\t\t\t\t\tgroup,\n\t\t\t\t\tkey: labels[i]\n\t\t\t\t}\n\n\t\t\t\tif (isNaN(datum)) {\n\t\t\t\t\tupdatedDatum['value'] = datum.value\n\t\t\t\t\tupdatedDatum['date'] = datum.date\n\t\t\t\t} else {\n\t\t\t\t\tupdatedDatum['value'] = datum\n\t\t\t\t}\n\n\t\t\t\ttabularData.push(updatedDatum)\n\t\t\t})\n\t\t})\n\n\t\treturn tabularData\n\t}\n\n\tgetTabularDataArray(): ChartTabularData {\n\t\t//apply tableFormatter\n\t\treturn []\n\t}\n\n\texportToCSV() {\n\t\tconst data = this.getTabularDataArray().map(row =>\n\t\t\trow.map((column: any) => {\n\t\t\t\tconst columnValue = column === '–' ? '–' : column\n\n\t\t\t\t// Split by separators and quotes, then sanitize each part individually\n\t\t\t\tconst sanitizedParts = columnValue.split(/[,;'\"`]/).map(part => _sanitizeCsvCell(part))\n\t\t\t\treturn `\"${sanitizedParts.join('')}\"`\n\t\t\t})\n\t\t)\n\n\t\tconst csvString = data.map(row => row.join(',')).join('\\n')\n\n\t\tconst options = this.getOptions()\n\n\t\tlet fileName = 'myChart'\n\t\tconst customFilename = getProperty(options, 'fileDownload', 'fileName')\n\n\t\tif (typeof customFilename === 'function') {\n\t\t\tfileName = customFilename('csv')\n\t\t} else if (typeof customFilename === 'string') {\n\t\t\tfileName = customFilename\n\t\t}\n\n\t\tthis.services.files.downloadCSV(csvString, `${fileName}.csv`)\n\t}\n\n\tprotected getTabularData(data: any) {\n\t\t// if data is not an array\n\t\tif (!Array.isArray(data)) {\n\t\t\treturn this.transformToTabularData(data)\n\t\t}\n\n\t\treturn data\n\t}\n\n\tprotected sanitize(data: any) {\n\t\tdata = this.getTabularData(data)\n\n\t\treturn data\n\t}\n\n\t/*\n\t * Data groups\n\t */\n\tprotected updateAllDataGroups() {\n\t\t// allDataGroups is used to generate a color scale that applies\n\t\t// to all the groups. Now when the data updates, you might remove a group,\n\t\t// and then bring it back in a newer data update, therefore\n\t\t// the order of the groups in allDataGroups matters so that you'd never\n\t\t// have an incorrect color assigned to a group.\n\n\t\t// Also, a new group should only be added to allDataGroups if\n\t\t// it doesn't currently exist\n\n\t\tif (!this.allDataGroups) {\n\t\t\tthis.allDataGroups = this.getDataGroupNames()\n\t\t} else {\n\t\t\t// Loop through current data groups\n\t\t\tthis.getDataGroupNames().forEach((dataGroupName: any) => {\n\t\t\t\t// If group name hasn't been stored yet, store it\n\t\t\t\tif (this.allDataGroups.indexOf(dataGroupName) === -1) {\n\t\t\t\t\tthis.allDataGroups.push(dataGroupName)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}\n\n\tprotected generateDataGroups(data: any) {\n\t\tconst { groupMapsTo } = this.getOptions().data\n\t\tconst { ACTIVE, DISABLED } = legendConfigs.items.status\n\t\tconst options = this.getOptions()\n\n\t\tconst uniqueDataGroups = uniq(data.map((datum: any) => datum[groupMapsTo]))\n\n\t\t// check if selectedGroups can be applied to chart with current data groups\n\t\tif (options.data.selectedGroups.length) {\n\t\t\tconst hasAllSelectedGroups = options.data.selectedGroups.every((groupName: any) =>\n\t\t\t\tuniqueDataGroups.includes(groupName)\n\t\t\t)\n\t\t\tif (!hasAllSelectedGroups) {\n\t\t\t\toptions.data.selectedGroups = []\n\t\t\t}\n\t\t}\n\n\t\t// Get group status based on items in selected groups\n\t\tconst getStatus = (groupName: any) =>\n\t\t\t!options.data.selectedGroups.length || options.data.selectedGroups.includes(groupName)\n\t\t\t\t? ACTIVE\n\t\t\t\t: DISABLED\n\n\t\treturn uniqueDataGroups.map(groupName => ({\n\t\t\tname: groupName,\n\t\t\tstatus: getStatus(groupName)\n\t\t}))\n\t}\n\n\t/*\n\t * Fill scales\n\t */\n\tprotected setCustomColorScale() {\n\t\tif (!this.isUserProvidedColorScaleValid()) {\n\t\t\treturn\n\t\t}\n\n\t\tconst options = this.getOptions()\n\t\tconst userProvidedScale = getProperty(options, 'color', 'scale')\n\n\t\tObject.keys(userProvidedScale).forEach(dataGroup => {\n\t\t\tif (!this.allDataGroups.includes(dataGroup)) {\n\t\t\t\tconsole.warn(`\"${dataGroup}\" does not exist in data groups.`)\n\t\t\t}\n\t\t})\n\n\t\t/**\n\t\t * Go through allDataGroups. If a data group has a color value provided\n\t\t * by the user, add that to the color range\n\t\t */\n\t\tconst providedDataGroups = this.allDataGroups.filter(dataGroup => userProvidedScale[dataGroup])\n\n\t\tprovidedDataGroups.forEach(\n\t\t\tdataGroup => (this.colorScale[dataGroup] = userProvidedScale[dataGroup])\n\t\t)\n\t}\n\n\t/*\n\t * Color palette\n\t */\n\tprotected setColorClassNames() {\n\t\tconst colorPairingOptions = getProperty(this.getOptions(), 'color', 'pairing')\n\n\t\t// Check if user has defined numberOfVariants (differ from given data)\n\t\tlet numberOfVariants = getProperty(colorPairingOptions, 'numberOfVariants')\n\t\tif (!numberOfVariants || numberOfVariants < this.allDataGroups.length) {\n\t\t\tnumberOfVariants = this.allDataGroups.length\n\t\t}\n\n\t\tlet pairingOption = getProperty(colorPairingOptions, 'option')\n\t\tconst colorPairingCounts = colorConfigs.pairingOptions\n\n\t\t// If number of dataGroups is greater than 5, user 14-color palette\n\t\tconst numberOfColors = numberOfVariants > 5 ? 14 : numberOfVariants\n\n\t\t// Use default palette if user choice is not in range\n\t\tconst key = `${numberOfColors}-color` as keyof typeof colorPairingCounts\n\t\tpairingOption = pairingOption <= colorPairingCounts[key] ? pairingOption : 1\n\n\t\t// Create color classes for graph, tooltip and stroke use\n\t\tconst colorPairing = this.allDataGroups.map(\n\t\t\t(_, index) => `${numberOfColors}-${pairingOption}-${(index % 14) + 1}`\n\t\t)\n\n\t\t// Create default color classnames\n\t\tthis.colorClassNames = scaleOrdinal().range(colorPairing).domain(this.allDataGroups)\n\t}\n}\n","export function resolveUrl(url, baseUrl) {\n // url is absolute already\n if (url.match(/^[a-z]+:\\/\\//i)) {\n return url;\n }\n // url is absolute already, without protocol\n if (url.match(/^\\/\\//)) {\n return window.location.protocol + url;\n }\n // dataURI, mailto:, tel:, etc.\n if (url.match(/^[a-z]+:/i)) {\n return url;\n }\n const doc = document.implementation.createHTMLDocument();\n const base = doc.createElement('base');\n const a = doc.createElement('a');\n doc.head.appendChild(base);\n doc.body.appendChild(a);\n if (baseUrl) {\n base.href = baseUrl;\n }\n a.href = url;\n return a.href;\n}\nexport const uuid = (() => {\n // generate uuid for className of pseudo elements.\n // We should not use GUIDs, otherwise pseudo elements sometimes cannot be captured.\n let counter = 0;\n // ref: http://stackoverflow.com/a/6248722/2519373\n const random = () => \n // eslint-disable-next-line no-bitwise\n `0000${((Math.random() * 36 ** 4) << 0).toString(36)}`.slice(-4);\n return () => {\n counter += 1;\n return `u${random()}${counter}`;\n };\n})();\nexport function delay(ms) {\n return (args) => new Promise((resolve) => {\n setTimeout(() => resolve(args), ms);\n });\n}\nexport function toArray(arrayLike) {\n const arr = [];\n for (let i = 0, l = arrayLike.length; i < l; i++) {\n arr.push(arrayLike[i]);\n }\n return arr;\n}\nfunction px(node, styleProperty) {\n const win = node.ownerDocument.defaultView || window;\n const val = win.getComputedStyle(node).getPropertyValue(styleProperty);\n return val ? parseFloat(val.replace('px', '')) : 0;\n}\nfunction getNodeWidth(node) {\n const leftBorder = px(node, 'border-left-width');\n const rightBorder = px(node, 'border-right-width');\n return node.clientWidth + leftBorder + rightBorder;\n}\nfunction getNodeHeight(node) {\n const topBorder = px(node, 'border-top-width');\n const bottomBorder = px(node, 'border-bottom-width');\n return node.clientHeight + topBorder + bottomBorder;\n}\nexport function getImageSize(targetNode, options = {}) {\n const width = options.width || getNodeWidth(targetNode);\n const height = options.height || getNodeHeight(targetNode);\n return { width, height };\n}\nexport function getPixelRatio() {\n let ratio;\n let FINAL_PROCESS;\n try {\n FINAL_PROCESS = process;\n }\n catch (e) {\n // pass\n }\n const val = FINAL_PROCESS && FINAL_PROCESS.env\n ? FINAL_PROCESS.env.devicePixelRatio\n : null;\n if (val) {\n ratio = parseInt(val, 10);\n if (Number.isNaN(ratio)) {\n ratio = 1;\n }\n }\n return ratio || window.devicePixelRatio || 1;\n}\n// @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas#maximum_canvas_size\nconst canvasDimensionLimit = 16384;\nexport function checkCanvasDimensions(canvas) {\n if (canvas.width > canvasDimensionLimit ||\n canvas.height > canvasDimensionLimit) {\n if (canvas.width > canvasDimensionLimit &&\n canvas.height > canvasDimensionLimit) {\n if (canvas.width > canvas.height) {\n canvas.height *= canvasDimensionLimit / canvas.width;\n canvas.width = canvasDimensionLimit;\n }\n else {\n canvas.width *= canvasDimensionLimit / canvas.height;\n canvas.height = canvasDimensionLimit;\n }\n }\n else if (canvas.width > canvasDimensionLimit) {\n canvas.height *= canvasDimensionLimit / canvas.width;\n canvas.width = canvasDimensionLimit;\n }\n else {\n canvas.width *= canvasDimensionLimit / canvas.height;\n canvas.height = canvasDimensionLimit;\n }\n }\n}\nexport function canvasToBlob(canvas, options = {}) {\n if (canvas.toBlob) {\n return new Promise((resolve) => {\n canvas.toBlob(resolve, options.type ? options.type : 'image/png', options.quality ? options.quality : 1);\n });\n }\n return new Promise((resolve) => {\n const binaryString = window.atob(canvas\n .toDataURL(options.type ? options.type : undefined, options.quality ? options.quality : undefined)\n .split(',')[1]);\n const len = binaryString.length;\n const binaryArray = new Uint8Array(len);\n for (let i = 0; i < len; i += 1) {\n binaryArray[i] = binaryString.charCodeAt(i);\n }\n resolve(new Blob([binaryArray], {\n type: options.type ? options.type : 'image/png',\n }));\n });\n}\nexport function createImage(url) {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.decode = () => resolve(img);\n img.onload = () => resolve(img);\n img.onerror = reject;\n img.crossOrigin = 'anonymous';\n img.decoding = 'async';\n img.src = url;\n });\n}\nexport async function svgToDataURL(svg) {\n return Promise.resolve()\n .then(() => new XMLSerializer().serializeToString(svg))\n .then(encodeURIComponent)\n .then((html) => `data:image/svg+xml;charset=utf-8,${html}`);\n}\nexport async function nodeToDataURL(node, width, height) {\n const xmlns = 'http://www.w3.org/2000/svg';\n const svg = document.createElementNS(xmlns, 'svg');\n const foreignObject = document.createElementNS(xmlns, 'foreignObject');\n svg.setAttribute('width', `${width}`);\n svg.setAttribute('height', `${height}`);\n svg.setAttribute('viewBox', `0 0 ${width} ${height}`);\n foreignObject.setAttribute('width', '100%');\n foreignObject.setAttribute('height', '100%');\n foreignObject.setAttribute('x', '0');\n foreignObject.setAttribute('y', '0');\n foreignObject.setAttribute('externalResourcesRequired', 'true');\n svg.appendChild(foreignObject);\n foreignObject.appendChild(node);\n return svgToDataURL(svg);\n}\nexport const isInstanceOfElement = (node, instance) => {\n if (node instanceof instance)\n return true;\n const nodePrototype = Object.getPrototypeOf(node);\n if (nodePrototype === null)\n return false;\n return (nodePrototype.constructor.name === instance.name ||\n isInstanceOfElement(nodePrototype, instance));\n};\n//# sourceMappingURL=util.js.map","import { uuid, toArray } from './util';\nfunction formatCSSText(style) {\n const content = style.getPropertyValue('content');\n return `${style.cssText} content: '${content.replace(/'|\"/g, '')}';`;\n}\nfunction formatCSSProperties(style) {\n return toArray(style)\n .map((name) => {\n const value = style.getPropertyValue(name);\n const priority = style.getPropertyPriority(name);\n return `${name}: ${value}${priority ? ' !important' : ''};`;\n })\n .join(' ');\n}\nfunction getPseudoElementStyle(className, pseudo, style) {\n const selector = `.${className}:${pseudo}`;\n const cssText = style.cssText\n ? formatCSSText(style)\n : formatCSSProperties(style);\n return document.createTextNode(`${selector}{${cssText}}`);\n}\nfunction clonePseudoElement(nativeNode, clonedNode, pseudo) {\n const style = window.getComputedStyle(nativeNode, pseudo);\n const content = style.getPropertyValue('content');\n if (content === '' || content === 'none') {\n return;\n }\n const className = uuid();\n try {\n clonedNode.className = `${clonedNode.className} ${className}`;\n }\n catch (err) {\n return;\n }\n const styleElement = document.createElement('style');\n styleElement.appendChild(getPseudoElementStyle(className, pseudo, style));\n clonedNode.appendChild(styleElement);\n}\nexport function clonePseudoElements(nativeNode, clonedNode) {\n clonePseudoElement(nativeNode, clonedNode, ':before');\n clonePseudoElement(nativeNode, clonedNode, ':after');\n}\n//# sourceMappingURL=clone-pseudos.js.map","const WOFF = 'application/font-woff';\nconst JPEG = 'image/jpeg';\nconst mimes = {\n woff: WOFF,\n woff2: WOFF,\n ttf: 'application/font-truetype',\n eot: 'application/vnd.ms-fontobject',\n png: 'image/png',\n jpg: JPEG,\n jpeg: JPEG,\n gif: 'image/gif',\n tiff: 'image/tiff',\n svg: 'image/svg+xml',\n webp: 'image/webp',\n};\nfunction getExtension(url) {\n const match = /\\.([^./]*?)$/g.exec(url);\n return match ? match[1] : '';\n}\nexport function getMimeType(url) {\n const extension = getExtension(url).toLowerCase();\n return mimes[extension] || '';\n}\n//# sourceMappingURL=mimes.js.map","function getContentFromDataUrl(dataURL) {\n return dataURL.split(/,/)[1];\n}\nexport function isDataUrl(url) {\n return url.search(/^(data:)/) !== -1;\n}\nexport function makeDataUrl(content, mimeType) {\n return `data:${mimeType};base64,${content}`;\n}\nexport async function fetchAsDataURL(url, init, process) {\n const res = await fetch(url, init);\n if (res.status === 404) {\n throw new Error(`Resource \"${res.url}\" not found`);\n }\n const blob = await res.blob();\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onerror = reject;\n reader.onloadend = () => {\n try {\n resolve(process({ res, result: reader.result }));\n }\n catch (error) {\n reject(error);\n }\n };\n reader.readAsDataURL(blob);\n });\n}\nconst cache = {};\nfunction getCacheKey(url, contentType, includeQueryParams) {\n let key = url.replace(/\\?.*/, '');\n if (includeQueryParams) {\n key = url;\n }\n // font resource\n if (/ttf|otf|eot|woff2?/i.test(key)) {\n key = key.replace(/.*\\//, '');\n }\n return contentType ? `[${contentType}]${key}` : key;\n}\nexport async function resourceToDataURL(resourceUrl, contentType, options) {\n const cacheKey = getCacheKey(resourceUrl, contentType, options.includeQueryParams);\n if (cache[cacheKey] != null) {\n return cache[cacheKey];\n }\n // ref: https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache\n if (options.cacheBust) {\n // eslint-disable-next-line no-param-reassign\n resourceUrl += (/\\?/.test(resourceUrl) ? '&' : '?') + new Date().getTime();\n }\n let dataURL;\n try {\n const content = await fetchAsDataURL(resourceUrl, options.fetchRequestInit, ({ res, result }) => {\n if (!contentType) {\n // eslint-disable-next-line no-param-reassign\n contentType = res.headers.get('Content-Type') || '';\n }\n return getContentFromDataUrl(result);\n });\n dataURL = makeDataUrl(content, contentType);\n }\n catch (error) {\n dataURL = options.imagePlaceholder || '';\n let msg = `Failed to fetch resource: ${resourceUrl}`;\n if (error) {\n msg = typeof error === 'string' ? error : error.message;\n }\n if (msg) {\n console.warn(msg);\n }\n }\n cache[cacheKey] = dataURL;\n return dataURL;\n}\n//# sourceMappingURL=dataurl.js.map","import { clonePseudoElements } from './clone-pseudos';\nimport { createImage, toArray, isInstanceOfElement } from './util';\nimport { getMimeType } from './mimes';\nimport { resourceToDataURL } from './dataurl';\nasync function cloneCanvasElement(canvas) {\n const dataURL = canvas.toDataURL();\n if (dataURL === 'data:,') {\n return canvas.cloneNode(false);\n }\n return createImage(dataURL);\n}\nasync function cloneVideoElement(video, options) {\n if (video.currentSrc) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n canvas.width = video.clientWidth;\n canvas.height = video.clientHeight;\n ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);\n const dataURL = canvas.toDataURL();\n return createImage(dataURL);\n }\n const poster = video.poster;\n const contentType = getMimeType(poster);\n const dataURL = await resourceToDataURL(poster, contentType, options);\n return createImage(dataURL);\n}\nasync function cloneIFrameElement(iframe) {\n var _a;\n try {\n if ((_a = iframe === null || iframe === void 0 ? void 0 : iframe.contentDocument) === null || _a === void 0 ? void 0 : _a.body) {\n return (await cloneNode(iframe.contentDocument.body, {}, true));\n }\n }\n catch (_b) {\n // Failed to clone iframe\n }\n return iframe.cloneNode(false);\n}\nasync function cloneSingleNode(node, options) {\n if (isInstanceOfElement(node, HTMLCanvasElement)) {\n return cloneCanvasElement(node);\n }\n if (isInstanceOfElement(node, HTMLVideoElement)) {\n return cloneVideoElement(node, options);\n }\n if (isInstanceOfElement(node, HTMLIFrameElement)) {\n return cloneIFrameElement(node);\n }\n return node.cloneNode(false);\n}\nconst isSlotElement = (node) => node.tagName != null && node.tagName.toUpperCase() === 'SLOT';\nasync function cloneChildren(nativeNode, clonedNode, options) {\n var _a, _b;\n let children = [];\n if (isSlotElement(nativeNode) && nativeNode.assignedNodes) {\n children = toArray(nativeNode.assignedNodes());\n }\n else if (isInstanceOfElement(nativeNode, HTMLIFrameElement) &&\n ((_a = nativeNode.contentDocument) === null || _a === void 0 ? void 0 : _a.body)) {\n children = toArray(nativeNode.contentDocument.body.childNodes);\n }\n else {\n children = toArray(((_b = nativeNode.shadowRoot) !== null && _b !== void 0 ? _b : nativeNode).childNodes);\n }\n if (children.length === 0 ||\n isInstanceOfElement(nativeNode, HTMLVideoElement)) {\n return clonedNode;\n }\n await children.reduce((deferred, child) => deferred\n .then(() => cloneNode(child, options))\n .then((clonedChild) => {\n if (clonedChild) {\n clonedNode.appendChild(clonedChild);\n }\n }), Promise.resolve());\n return clonedNode;\n}\nfunction cloneCSSStyle(nativeNode, clonedNode) {\n const targetStyle = clonedNode.style;\n if (!targetStyle) {\n return;\n }\n const sourceStyle = window.getComputedStyle(nativeNode);\n if (sourceStyle.cssText) {\n targetStyle.cssText = sourceStyle.cssText;\n targetStyle.transformOrigin = sourceStyle.transformOrigin;\n }\n else {\n toArray(sourceStyle).forEach((name) => {\n let value = sourceStyle.getPropertyValue(name);\n if (name === 'font-size' && value.endsWith('px')) {\n const reducedFont = Math.floor(parseFloat(value.substring(0, value.length - 2))) - 0.1;\n value = `${reducedFont}px`;\n }\n if (isInstanceOfElement(nativeNode, HTMLIFrameElement) &&\n name === 'display' &&\n value === 'inline') {\n value = 'block';\n }\n if (name === 'd' && clonedNode.getAttribute('d')) {\n value = `path(${clonedNode.getAttribute('d')})`;\n }\n targetStyle.setProperty(name, value, sourceStyle.getPropertyPriority(name));\n });\n }\n}\nfunction cloneInputValue(nativeNode, clonedNode) {\n if (isInstanceOfElement(nativeNode, HTMLTextAreaElement)) {\n clonedNode.innerHTML = nativeNode.value;\n }\n if (isInstanceOfElement(nativeNode, HTMLInputElement)) {\n clonedNode.setAttribute('value', nativeNode.value);\n }\n}\nfunction cloneSelectValue(nativeNode, clonedNode) {\n if (isInstanceOfElement(nativeNode, HTMLSelectElement)) {\n const clonedSelect = clonedNode;\n const selectedOption = Array.from(clonedSelect.children).find((child) => nativeNode.value === child.getAttribute('value'));\n if (selectedOption) {\n selectedOption.setAttribute('selected', '');\n }\n }\n}\nfunction decorate(nativeNode, clonedNode) {\n if (isInstanceOfElement(clonedNode, Element)) {\n cloneCSSStyle(nativeNode, clonedNode);\n clonePseudoElements(nativeNode, clonedNode);\n cloneInputValue(nativeNode, clonedNode);\n cloneSelectValue(nativeNode, clonedNode);\n }\n return clonedNode;\n}\nasync function ensureSVGSymbols(clone, options) {\n const uses = clone.querySelectorAll ? clone.querySelectorAll('use') : [];\n if (uses.length === 0) {\n return clone;\n }\n const processedDefs = {};\n for (let i = 0; i < uses.length; i++) {\n const use = uses[i];\n const id = use.getAttribute('xlink:href');\n if (id) {\n const exist = clone.querySelector(id);\n const definition = document.querySelector(id);\n if (!exist && definition && !processedDefs[id]) {\n // eslint-disable-next-line no-await-in-loop\n processedDefs[id] = (await cloneNode(definition, options, true));\n }\n }\n }\n const nodes = Object.values(processedDefs);\n if (nodes.length) {\n const ns = 'http://www.w3.org/1999/xhtml';\n const svg = document.createElementNS(ns, 'svg');\n svg.setAttribute('xmlns', ns);\n svg.style.position = 'absolute';\n svg.style.width = '0';\n svg.style.height = '0';\n svg.style.overflow = 'hidden';\n svg.style.display = 'none';\n const defs = document.createElementNS(ns, 'defs');\n svg.appendChild(defs);\n for (let i = 0; i < nodes.length; i++) {\n defs.appendChild(nodes[i]);\n }\n clone.appendChild(svg);\n }\n return clone;\n}\nexport async function cloneNode(node, options, isRoot) {\n if (!isRoot && options.filter && !options.filter(node)) {\n return null;\n }\n return Promise.resolve(node)\n .then((clonedNode) => cloneSingleNode(clonedNode, options))\n .then((clonedNode) => cloneChildren(node, clonedNode, options))\n .then((clonedNode) => decorate(node, clonedNode))\n .then((clonedNode) => ensureSVGSymbols(clonedNode, options));\n}\n//# sourceMappingURL=clone-node.js.map","import { resolveUrl } from './util';\nimport { getMimeType } from './mimes';\nimport { isDataUrl, makeDataUrl, resourceToDataURL } from './dataurl';\nconst URL_REGEX = /url\\((['\"]?)([^'\"]+?)\\1\\)/g;\nconst URL_WITH_FORMAT_REGEX = /url\\([^)]+\\)\\s*format\\(([\"']?)([^\"']+)\\1\\)/g;\nconst FONT_SRC_REGEX = /src:\\s*(?:url\\([^)]+\\)\\s*format\\([^)]+\\)[,;]\\s*)+/g;\nfunction toRegex(url) {\n // eslint-disable-next-line no-useless-escape\n const escaped = url.replace(/([.*+?^${}()|\\[\\]\\/\\\\])/g, '\\\\$1');\n return new RegExp(`(url\\\\(['\"]?)(${escaped})(['\"]?\\\\))`, 'g');\n}\nexport function parseURLs(cssText) {\n const urls = [];\n cssText.replace(URL_REGEX, (raw, quotation, url) => {\n urls.push(url);\n return raw;\n });\n return urls.filter((url) => !isDataUrl(url));\n}\nexport async function embed(cssText, resourceURL, baseURL, options, getContentFromUrl) {\n try {\n const resolvedURL = baseURL ? resolveUrl(resourceURL, baseURL) : resourceURL;\n const contentType = getMimeType(resourceURL);\n let dataURL;\n if (getContentFromUrl) {\n const content = await getContentFromUrl(resolvedURL);\n dataURL = makeDataUrl(content, contentType);\n }\n else {\n dataURL = await resourceToDataURL(resolvedURL, contentType, options);\n }\n return cssText.replace(toRegex(resourceURL), `$1${dataURL}$3`);\n }\n catch (error) {\n // pass\n }\n return cssText;\n}\nfunction filterPreferredFontFormat(str, { preferredFontFormat }) {\n return !preferredFontFormat\n ? str\n : str.replace(FONT_SRC_REGEX, (match) => {\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const [src, , format] = URL_WITH_FORMAT_REGEX.exec(match) || [];\n if (!format) {\n return '';\n }\n if (format === preferredFontFormat) {\n return `src: ${src};`;\n }\n }\n });\n}\nexport function shouldEmbed(url) {\n return url.search(URL_REGEX) !== -1;\n}\nexport async function embedResources(cssText, baseUrl, options) {\n if (!shouldEmbed(cssText)) {\n return cssText;\n }\n const filteredCSSText = filterPreferredFontFormat(cssText, options);\n const urls = parseURLs(filteredCSSText);\n return urls.reduce((deferred, url) => deferred.then((css) => embed(css, url, baseUrl, options)), Promise.resolve(filteredCSSText));\n}\n//# sourceMappingURL=embed-resources.js.map","import { embedResources } from './embed-resources';\nimport { toArray, isInstanceOfElement } from './util';\nimport { isDataUrl, resourceToDataURL } from './dataurl';\nimport { getMimeType } from './mimes';\nasync function embedProp(propName, node, options) {\n var _a;\n const propValue = (_a = node.style) === null || _a === void 0 ? void 0 : _a.getPropertyValue(propName);\n if (propValue) {\n const cssString = await embedResources(propValue, null, options);\n node.style.setProperty(propName, cssString, node.style.getPropertyPriority(propName));\n return true;\n }\n return false;\n}\nasync function embedBackground(clonedNode, options) {\n if (!(await embedProp('background', clonedNode, options))) {\n await embedProp('background-image', clonedNode, options);\n }\n if (!(await embedProp('mask', clonedNode, options))) {\n await embedProp('mask-image', clonedNode, options);\n }\n}\nasync function embedImageNode(clonedNode, options) {\n const isImageElement = isInstanceOfElement(clonedNode, HTMLImageElement);\n if (!(isImageElement && !isDataUrl(clonedNode.src)) &&\n !(isInstanceOfElement(clonedNode, SVGImageElement) &&\n !isDataUrl(clonedNode.href.baseVal))) {\n return;\n }\n const url = isImageElement ? clonedNode.src : clonedNode.href.baseVal;\n const dataURL = await resourceToDataURL(url, getMimeType(url), options);\n await new Promise((resolve, reject) => {\n clonedNode.onload = resolve;\n clonedNode.onerror = reject;\n const image = clonedNode;\n if (image.decode) {\n image.decode = resolve;\n }\n if (image.loading === 'lazy') {\n image.loading = 'eager';\n }\n if (isImageElement) {\n clonedNode.srcset = '';\n clonedNode.src = dataURL;\n }\n else {\n clonedNode.href.baseVal = dataURL;\n }\n });\n}\nasync function embedChildren(clonedNode, options) {\n const children = toArray(clonedNode.childNodes);\n const deferreds = children.map((child) => embedImages(child, options));\n await Promise.all(deferreds).then(() => clonedNode);\n}\nexport async function embedImages(clonedNode, options) {\n if (isInstanceOfElement(clonedNode, Element)) {\n await embedBackground(clonedNode, options);\n await embedImageNode(clonedNode, options);\n await embedChildren(clonedNode, options);\n }\n}\n//# sourceMappingURL=embed-images.js.map","export function applyStyle(node, options) {\n const { style } = node;\n if (options.backgroundColor) {\n style.backgroundColor = options.backgroundColor;\n }\n if (options.width) {\n style.width = `${options.width}px`;\n }\n if (options.height) {\n style.height = `${options.height}px`;\n }\n const manual = options.style;\n if (manual != null) {\n Object.keys(manual).forEach((key) => {\n style[key] = manual[key];\n });\n }\n return node;\n}\n//# sourceMappingURL=apply-style.js.map","import { toArray } from './util';\nimport { fetchAsDataURL } from './dataurl';\nimport { shouldEmbed, embedResources } from './embed-resources';\nconst cssFetchCache = {};\nasync function fetchCSS(url) {\n let cache = cssFetchCache[url];\n if (cache != null) {\n return cache;\n }\n const res = await fetch(url);\n const cssText = await res.text();\n cache = { url, cssText };\n cssFetchCache[url] = cache;\n return cache;\n}\nasync function embedFonts(data, options) {\n let cssText = data.cssText;\n const regexUrl = /url\\([\"']?([^\"')]+)[\"']?\\)/g;\n const fontLocs = cssText.match(/url\\([^)]+\\)/g) || [];\n const loadFonts = fontLocs.map(async (loc) => {\n let url = loc.replace(regexUrl, '$1');\n if (!url.startsWith('https://')) {\n url = new URL(url, data.url).href;\n }\n return fetchAsDataURL(url, options.fetchRequestInit, ({ result }) => {\n cssText = cssText.replace(loc, `url(${result})`);\n return [loc, result];\n });\n });\n return Promise.all(loadFonts).then(() => cssText);\n}\nfunction parseCSS(source) {\n if (source == null) {\n return [];\n }\n const result = [];\n const commentsRegex = /(\\/\\*[\\s\\S]*?\\*\\/)/gi;\n // strip out comments\n let cssText = source.replace(commentsRegex, '');\n // eslint-disable-next-line prefer-regex-literals\n const keyframesRegex = new RegExp('((@.*?keyframes [\\\\s\\\\S]*?){([\\\\s\\\\S]*?}\\\\s*?)})', 'gi');\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const matches = keyframesRegex.exec(cssText);\n if (matches === null) {\n break;\n }\n result.push(matches[0]);\n }\n cssText = cssText.replace(keyframesRegex, '');\n const importRegex = /@import[\\s\\S]*?url\\([^)]*\\)[\\s\\S]*?;/gi;\n // to match css & media queries together\n const combinedCSSRegex = '((\\\\s*?(?:\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\/)?\\\\s*?@media[\\\\s\\\\S]' +\n '*?){([\\\\s\\\\S]*?)}\\\\s*?})|(([\\\\s\\\\S]*?){([\\\\s\\\\S]*?)})';\n // unified regex\n const unifiedRegex = new RegExp(combinedCSSRegex, 'gi');\n // eslint-disable-next-line no-constant-condition\n while (true) {\n let matches = importRegex.exec(cssText);\n if (matches === null) {\n matches = unifiedRegex.exec(cssText);\n if (matches === null) {\n break;\n }\n else {\n importRegex.lastIndex = unifiedRegex.lastIndex;\n }\n }\n else {\n unifiedRegex.lastIndex = importRegex.lastIndex;\n }\n result.push(matches[0]);\n }\n return result;\n}\nasync function getCSSRules(styleSheets, options) {\n const ret = [];\n const deferreds = [];\n // First loop inlines imports\n styleSheets.forEach((sheet) => {\n if ('cssRules' in sheet) {\n try {\n toArray(sheet.cssRules || []).forEach((item, index) => {\n if (item.type === CSSRule.IMPORT_RULE) {\n let importIndex = index + 1;\n const url = item.href;\n const deferred = fetchCSS(url)\n .then((metadata) => embedFonts(metadata, options))\n .then((cssText) => parseCSS(cssText).forEach((rule) => {\n try {\n sheet.insertRule(rule, rule.startsWith('@import')\n ? (importIndex += 1)\n : sheet.cssRules.length);\n }\n catch (error) {\n console.error('Error inserting rule from remote css', {\n rule,\n error,\n });\n }\n }))\n .catch((e) => {\n console.error('Error loading remote css', e.toString());\n });\n deferreds.push(deferred);\n }\n });\n }\n catch (e) {\n const inline = styleSheets.find((a) => a.href == null) || document.styleSheets[0];\n if (sheet.href != null) {\n deferreds.push(fetchCSS(sheet.href)\n .then((metadata) => embedFonts(metadata, options))\n .then((cssText) => parseCSS(cssText).forEach((rule) => {\n inline.insertRule(rule, sheet.cssRules.length);\n }))\n .catch((err) => {\n console.error('Error loading remote stylesheet', err);\n }));\n }\n console.error('Error inlining remote css file', e);\n }\n }\n });\n return Promise.all(deferreds).then(() => {\n // Second loop parses rules\n styleSheets.forEach((sheet) => {\n if ('cssRules' in sheet) {\n try {\n toArray(sheet.cssRules || []).forEach((item) => {\n ret.push(item);\n });\n }\n catch (e) {\n console.error(`Error while reading CSS rules from ${sheet.href}`, e);\n }\n }\n });\n return ret;\n });\n}\nfunction getWebFontRules(cssRules) {\n return cssRules\n .filter((rule) => rule.type === CSSRule.FONT_FACE_RULE)\n .filter((rule) => shouldEmbed(rule.style.getPropertyValue('src')));\n}\nasync function parseWebFontRules(node, options) {\n if (node.ownerDocument == null) {\n throw new Error('Provided element is not within a Document');\n }\n const styleSheets = toArray(node.ownerDocument.styleSheets);\n const cssRules = await getCSSRules(styleSheets, options);\n return getWebFontRules(cssRules);\n}\nexport async function getWebFontCSS(node, options) {\n const rules = await parseWebFontRules(node, options);\n const cssTexts = await Promise.all(rules.map((rule) => {\n const baseUrl = rule.parentStyleSheet ? rule.parentStyleSheet.href : null;\n return embedResources(rule.cssText, baseUrl, options);\n }));\n return cssTexts.join('\\n');\n}\nexport async function embedWebFonts(clonedNode, options) {\n const cssText = options.fontEmbedCSS != null\n ? options.fontEmbedCSS\n : options.skipFonts\n ? null\n : await getWebFontCSS(clonedNode, options);\n if (cssText) {\n const styleNode = document.createElement('style');\n const sytleContent = document.createTextNode(cssText);\n styleNode.appendChild(sytleContent);\n if (clonedNode.firstChild) {\n clonedNode.insertBefore(styleNode, clonedNode.firstChild);\n }\n else {\n clonedNode.appendChild(styleNode);\n }\n }\n}\n//# sourceMappingURL=embed-webfonts.js.map","import { cloneNode } from './clone-node';\nimport { embedImages } from './embed-images';\nimport { applyStyle } from './apply-style';\nimport { embedWebFonts, getWebFontCSS } from './embed-webfonts';\nimport { getImageSize, getPixelRatio, createImage, canvasToBlob, nodeToDataURL, checkCanvasDimensions, } from './util';\nexport async function toSvg(node, options = {}) {\n const { width, height } = getImageSize(node, options);\n const clonedNode = (await cloneNode(node, options, true));\n await embedWebFonts(clonedNode, options);\n await embedImages(clonedNode, options);\n applyStyle(clonedNode, options);\n const datauri = await nodeToDataURL(clonedNode, width, height);\n return datauri;\n}\nexport async function toCanvas(node, options = {}) {\n const { width, height } = getImageSize(node, options);\n const svg = await toSvg(node, options);\n const img = await createImage(svg);\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n const ratio = options.pixelRatio || getPixelRatio();\n const canvasWidth = options.canvasWidth || width;\n const canvasHeight = options.canvasHeight || height;\n canvas.width = canvasWidth * ratio;\n canvas.height = canvasHeight * ratio;\n if (!options.skipAutoScale) {\n checkCanvasDimensions(canvas);\n }\n canvas.style.width = `${canvasWidth}`;\n canvas.style.height = `${canvasHeight}`;\n if (options.backgroundColor) {\n context.fillStyle = options.backgroundColor;\n context.fillRect(0, 0, canvas.width, canvas.height);\n }\n context.drawImage(img, 0, 0, canvas.width, canvas.height);\n return canvas;\n}\nexport async function toPixelData(node, options = {}) {\n const { width, height } = getImageSize(node, options);\n const canvas = await toCanvas(node, options);\n const ctx = canvas.getContext('2d');\n return ctx.getImageData(0, 0, width, height).data;\n}\nexport async function toPng(node, options = {}) {\n const canvas = await toCanvas(node, options);\n return canvas.toDataURL();\n}\nexport async function toJpeg(node, options = {}) {\n const canvas = await toCanvas(node, options);\n return canvas.toDataURL('image/jpeg', options.quality || 1);\n}\nexport async function toBlob(node, options = {}) {\n const canvas = await toCanvas(node, options);\n const blob = await canvasToBlob(canvas);\n return blob;\n}\nexport async function getFontEmbedCSS(node, options = {}) {\n return getWebFontCSS(node, options);\n}\n//# sourceMappingURL=index.js.map","import type { ChartModel } from '@/model/model'\nimport type { Services } from '@/interfaces/services'\n\nexport class Service {\n\tprotected model: ChartModel\n\tprotected services: Services\n\n\tconstructor(model: ChartModel, services: Services) {\n\t\tthis.model = model\n\t\tthis.services = services\n\n\t\tthis.init()\n\t}\n\n\tinit() {\n\t\t// do nothing.\n\t}\n\n\tupdate() {\n\t\t// do nothing.\n\t}\n\n\t// Used to pass down information to the components\n\tsetModel(newObj: ChartModel) {\n\t\tthis.model = newObj\n\t}\n\n\t// Used to pass down services to the components\n\tsetServices(newObj: Services) {\n\t\tthis.services = newObj\n\t}\n}\n","import { select, type Selection } from 'd3'\nimport { toPng, toJpeg } from 'html-to-image'\nimport { debounce } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { carbonPrefix } from '@/configuration-non-customizable' // CSS prefix\nimport type { ChartModel } from '@/model/model'\nimport { Service } from '@/services/service'\nimport { Events } from '@/interfaces/enums'\n\nconst CSS_VERIFIER_ELEMENT_CLASSNAME = 'DONT_STYLE_ME_css_styles_verifier'\n\n// Functions like validateAndSetDimensions() may return strings or numbers\nexport interface Dimensions {\n\theight: number\n\twidth: number\n}\n\nexport interface getSVGElementSizeOptions {\n\tuseAttrs?: boolean\n\tuseClientDimensions?: boolean\n\tuseBBox?: boolean\n\tuseBoundingRect?: boolean\n}\n\nexport class DOMUtils extends Service {\n\tprivate chartID!: string // initialized in initializeID() called by init()\n\n\tconstructor(model: ChartModel, services: any) {\n\t\tsuper(model, services)\n\t}\n\n\tstatic getHTMLElementSize(element: HTMLElement) {\n\t\treturn {\n\t\t\twidth: element.clientWidth,\n\t\t\theight: element.clientHeight\n\t\t}\n\t}\n\n\tstatic getSVGElementSize(\n\t\tsvgSelector: Selection,\n\t\toptions: getSVGElementSizeOptions = {\n\t\t\tuseAttrs: false,\n\t\t\tuseClientDimensions: false,\n\t\t\tuseBBox: false,\n\t\t\tuseBoundingRect: false\n\t\t}\n\t) {\n\t\tif (!svgSelector.attr) {\n\t\t\tsvgSelector = select(svgSelector as any) // issue with @types/d3 - select can handle Selection parameters just fine\n\t\t}\n\n\t\tconst finalDimensions = {\n\t\t\twidth: 0,\n\t\t\theight: 0\n\t\t}\n\n\t\t// Dimensions can be width and height as numbers or strings\n\t\tconst validateAndSetDimensions = (dimensions: any) => {\n\t\t\tif (dimensions) {\n\t\t\t\tObject.keys(finalDimensions).forEach((dimensionKey: 'width' | 'height') => {\n\t\t\t\t\tif (dimensions[dimensionKey]) {\n\t\t\t\t\t\tconst dimension = dimensions[dimensionKey]\n\t\t\t\t\t\tconst dimensionNumber = parseFloat(dimension)\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tdimension &&\n\t\t\t\t\t\t\tdimensionNumber > finalDimensions[dimensionKey] &&\n\t\t\t\t\t\t\t('' + dimension).indexOf('%') === -1\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tfinalDimensions[dimensionKey] = dimensionNumber\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\tconst attrDimensions = {\n\t\t\twidth: svgSelector.attr('width'),\n\t\t\theight: svgSelector.attr('height')\n\t\t}\n\n\t\tconst svgElement = svgSelector.node()\n\n\t\tlet bbox: DOMRect,\n\t\t\tbboxDimensions: Dimensions,\n\t\t\tboundingRect: DOMRect,\n\t\t\tboundingRectDimensions: Dimensions\n\n\t\ttry {\n\t\t\t// Not all SVG graphics elements have bounding boxes (eg , , <styles>)\n\t\t\tif (typeof svgElement.getBBox === 'function') {\n\t\t\t\tbbox = svgElement.getBBox()\n\t\t\t\tbboxDimensions = {\n\t\t\t\t\twidth: bbox.width,\n\t\t\t\t\theight: bbox.height\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\n\t\ttry {\n\t\t\t// Not all SVG graphics elements have...\n\t\t\tif (typeof svgElement?.getBoundingClientRect === 'function') {\n\t\t\t\tboundingRect = svgElement.getBoundingClientRect()\n\t\t\t\tboundingRectDimensions = {\n\t\t\t\t\twidth: boundingRect.width,\n\t\t\t\t\theight: boundingRect.height\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\n\t\t// Not all SVG graphics elements have...\n\t\tlet clientDimensions: Dimensions\n\t\tif (svgElement instanceof SVGSVGElement) {\n\t\t\tclientDimensions = {\n\t\t\t\twidth: svgElement.clientWidth,\n\t\t\t\theight: svgElement.clientHeight\n\t\t\t}\n\t\t}\n\n\t\t// If both attribute values are numbers\n\t\t// And not percentages or NaN\n\t\tif (options) {\n\t\t\tif (options.useAttrs) {\n\t\t\t\tvalidateAndSetDimensions(attrDimensions)\n\n\t\t\t\tif (finalDimensions.width > 0 && finalDimensions.height > 0) {\n\t\t\t\t\treturn finalDimensions\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (options.useClientDimensions) {\n\t\t\t\tvalidateAndSetDimensions(clientDimensions)\n\n\t\t\t\tif (finalDimensions.width > 0 && finalDimensions.height > 0) {\n\t\t\t\t\treturn clientDimensions\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (options.useBBox) {\n\t\t\t\tvalidateAndSetDimensions(bboxDimensions)\n\n\t\t\t\tif (finalDimensions.width > 0 && finalDimensions.height > 0) {\n\t\t\t\t\treturn bboxDimensions\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (options.useBoundingRect) {\n\t\t\t\tvalidateAndSetDimensions(boundingRectDimensions)\n\n\t\t\t\tif (finalDimensions.width > 0 && finalDimensions.height > 0) {\n\t\t\t\t\treturn boundingRectDimensions\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tconst nativeDimensions = {\n\t\t\t\twidth: getProperty(svgSelector.node(), 'width', 'baseVal', 'value'),\n\t\t\t\theight: getProperty(svgSelector.node(), 'height', 'baseVal', 'value')\n\t\t\t}\n\n\t\t\tvalidateAndSetDimensions(nativeDimensions)\n\t\t} catch (e) {\n\t\t\tvalidateAndSetDimensions(clientDimensions)\n\t\t\tvalidateAndSetDimensions(bboxDimensions)\n\t\t\tvalidateAndSetDimensions(attrDimensions)\n\t\t}\n\t\treturn finalDimensions\n\t}\n\n\tstatic appendOrSelect(\n\t\tparent: Selection<SVGElement | HTMLDivElement, any, Element, any>,\n\t\tquery: string\n\t) {\n\t\tconst selection = parent.select(`${query}`)\n\n\t\tif (selection.empty()) {\n\t\t\t// see if there is an id\n\t\t\tlet querySections = query.split('#')\n\t\t\tlet elementToAppend: any\n\t\t\tlet id: string\n\t\t\t// if there is an id\n\t\t\tif (querySections.length === 2) {\n\t\t\t\t// take out the element to append\n\t\t\t\telementToAppend = querySections[0]\n\t\t\t\t// split it by classes\n\t\t\t\tquerySections = querySections[1].split('.')\n\t\t\t\t// the first string is the id\n\t\t\t\tid = querySections[0]\n\t\t\t} else {\n\t\t\t\tquerySections = query.split('.')\n\t\t\t\telementToAppend = querySections[0]\n\t\t\t}\n\n\t\t\treturn parent\n\t\t\t\t.append(elementToAppend)\n\t\t\t\t.attr('id', id)\n\t\t\t\t.attr('class', querySections.slice(1).join(' '))\n\t\t}\n\n\t\treturn selection\n\t}\n\n\tprotected mainContainer: HTMLDivElement\n\tprotected width: string\n\tprotected height: string\n\n\tinit() {\n\t\t// Initialize chart ID\n\t\tthis.initializeID()\n\n\t\t// Add width & height to the chart holder if necessary, and add a classname\n\t\tthis.styleHolderElement()\n\n\t\tthis.addMainContainer()\n\n\t\tif (this.model.getOptions().resizable) {\n\t\t\tthis.addResizeListener()\n\t\t}\n\n\t\tthis.addHolderListeners()\n\n\t\tthis.handleFullscreenChange()\n\t}\n\n\tgetChartID() {\n\t\treturn this.chartID\n\t}\n\n\tgenerateElementIDString(originalID: string | number) {\n\t\treturn `chart-${this.chartID}-${originalID}`\n\t}\n\n\tprivate initializeID() {\n\t\tthis.chartID = Math.floor((1 + Math.random()) * 0x1000000000000).toString(16)\n\t}\n\n\taddMainContainer() {\n\t\tconst options = this.model.getOptions()\n\t\tconst chartsprefix = getProperty(options, 'style', 'prefix')\n\n\t\tconst mainContainer = select(this.getHolder())\n\t\t\t.append('div')\n\t\t\t.classed(`${carbonPrefix}--${chartsprefix}--chart-wrapper`, true)\n\t\t\t.attr('id', `chart-${this.getChartID()}`)\n\t\t\t.style('height', '100%')\n\t\t\t.style('width', '100%')\n\n\t\tmainContainer.append('g').attr('class', CSS_VERIFIER_ELEMENT_CLASSNAME)\n\n\t\tthis.mainContainer = mainContainer.node()\n\t}\n\n\tupdate() {\n\t\tthis.styleHolderElement()\n\t}\n\n\tstyleHolderElement() {\n\t\tconst holderElement = this.getHolder() as HTMLElement\n\n\t\t// In order for resize events to not clash with these updates\n\t\t// We'll check if the width & height values passed in options\n\t\t// Have changed, before setting them to the holder\n\t\tconst { width, height, theme } = this.model.getOptions()\n\t\tif (width !== this.width) {\n\t\t\t// Apply formatted width attribute to chart\n\t\t\tholderElement.style.width = width\n\n\t\t\tthis.width = width\n\t\t}\n\n\t\tif (height !== this.height) {\n\t\t\t// Apply formatted width attribute to chart\n\t\t\tholderElement.style.height = height\n\n\t\t\tthis.height = height\n\t\t}\n\n\t\t// Add class to chart holder\n\t\tselect(this.getHolder())\n\t\t\t.classed(`${carbonPrefix}--chart-holder`, true)\n\t\t\t.attr('data-carbon-theme', theme)\n\t}\n\n\tgetHolder() {\n\t\treturn this.model.get('holder')\n\t}\n\n\texportToJPG() {\n\t\tconst self = this\n\t\tconst options = this.model.getOptions()\n\n\t\tconst holder = this.getHolder()\n\t\tconst holderSelection = select(holder)\n\t\tholderSelection.classed('filled', true)\n\n\t\ttoJpeg(this.getMainContainer(), {\n\t\t\tquality: 1,\n\t\t\t// Remove toolbar\n\t\t\tfilter: (node: any) => {\n\t\t\t\tif (node.classList && node.classList.contains('cds--cc--toolbar')) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\treturn true\n\t\t\t}\n\t\t}).then(function (dataUrl: string) {\n\t\t\tlet fileName = 'myChart'\n\t\t\tconst customFilename = getProperty(options, 'fileDownload', 'fileName')\n\n\t\t\tif (typeof customFilename === 'function') {\n\t\t\t\tfileName = customFilename('jpg')\n\t\t\t} else if (typeof customFilename === 'string') {\n\t\t\t\tfileName = customFilename\n\t\t\t}\n\n\t\t\tself.services.files?.downloadImage(dataUrl, `${fileName}.jpg`)\n\n\t\t\tholderSelection.classed('filled', false)\n\t\t})\n\t}\n\n\texportToPNG() {\n\t\tconst self = this\n\t\tconst options = this.model.getOptions()\n\n\t\tconst holder = this.getHolder()\n\t\tconst holderSelection = select(holder)\n\t\tholderSelection.classed('filled', true)\n\n\t\ttoPng(this.getMainContainer(), {\n\t\t\tquality: 1,\n\t\t\t// Remove toolbar\n\t\t\tfilter: (node: HTMLElement) => {\n\t\t\t\tif (node.classList && node.classList.contains('cds--cc--toolbar')) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\treturn true\n\t\t\t}\n\t\t})\n\t\t\t.then(function (dataUrl: string) {\n\t\t\t\tlet fileName = 'myChart'\n\t\t\t\tconst customFilename = getProperty(options, 'fileDownload', 'fileName')\n\n\t\t\t\tif (typeof customFilename === 'function') {\n\t\t\t\t\tfileName = customFilename('png')\n\t\t\t\t} else if (typeof customFilename === 'string') {\n\t\t\t\t\tfileName = customFilename\n\t\t\t\t}\n\n\t\t\t\tself.services.files?.downloadImage(dataUrl, `${fileName}.png`)\n\n\t\t\t\tholderSelection.classed('filled', false)\n\t\t\t})\n\t\t\t.catch(function (error: Error) {\n\t\t\t\tconsole.error('oops, something went wrong!', error)\n\t\t\t})\n\t}\n\n\ttoggleFullscreen() {\n\t\tconst holder = this.getHolder()\n\t\tconst holderSelection = select(holder)\n\n\t\tconst isFullScreen = holderSelection.classed('fullscreen')\n\n\t\tif (\n\t\t\tisFullScreen &&\n\t\t\t(document.fullscreenElement ||\n\t\t\t\tdocument['webkitFullscreenElement'] ||\n\t\t\t\tdocument['mozFullScreenElement'] ||\n\t\t\t\tdocument['msFullscreenElement'])\n\t\t) {\n\t\t\t// Call the correct function depending on the browser\n\t\t\tif (document.exitFullscreen) {\n\t\t\t\tdocument.exitFullscreen()\n\t\t\t} else if (document['webkitExitFullscreen']) {\n\t\t\t\tdocument['webkitExitFullscreen']()\n\t\t\t} else if (document['mozCancelFullScreen']) {\n\t\t\t\tdocument['mozCancelFullScreen']()\n\t\t\t} else if (document['msExitFullscreen']) {\n\t\t\t\tdocument['msExitFullscreen']()\n\t\t\t}\n\t\t} else {\n\t\t\t// Call the correct function depending on the browser\n\t\t\tif (holder.requestFullscreen) {\n\t\t\t\tholder.requestFullscreen()\n\t\t\t} else if (holder.webkitRequestFullscreen) {\n\t\t\t\tholder.webkitRequestFullscreen()\n\t\t\t} else if (holder.mozRequestFullScreen) {\n\t\t\t\tholder.mozRequestFullScreen()\n\t\t\t} else if (holder.msRequestFullscreen) {\n\t\t\t\tholder.msRequestFullscreen()\n\t\t\t}\n\t\t}\n\t}\n\n\thandleFullscreenChange() {\n\t\tdocument.addEventListener('fullscreenchange', () => {\n\t\t\tconst holderSelection = select(this.getHolder())\n\t\t\tconst isFullScreen = holderSelection.classed('fullscreen')\n\n\t\t\t// Toggle the `fullscreen` classname\n\t\t\tholderSelection.classed('fullscreen', !isFullScreen)\n\t\t})\n\t}\n\n\tsetSVGMaxHeight() {\n\t\t// if there is a set height on the holder, leave the chart svg height at 100%\n\t\tif (!this.model.getOptions().height) {\n\t\t\tconst { height: chartHeight } = DOMUtils.getSVGElementSize(\n\t\t\t\tselect(this.mainContainer) as any,\n\t\t\t\t{\n\t\t\t\t\tuseBBox: true\n\t\t\t\t}\n\t\t\t)\n\t\t\tconst chartSVGSelector = select(this.mainContainer).attr('class')\n\t\t\tconst children = select(this.mainContainer).selectAll(`.${chartSVGSelector} > svg`)\n\n\t\t\t// get the height of the children SVGs (spacers, titles, etc)\n\t\t\tlet childrenHeight = 0\n\t\t\tchildren.nodes().forEach(function (childSVG) {\n\t\t\t\tchildrenHeight += Number(\n\t\t\t\t\tDOMUtils.getSVGElementSize(select<SVGGraphicsElement, any>(childSVG as any), {\n\t\t\t\t\t\tuseBBox: true\n\t\t\t\t\t}).height\n\t\t\t\t)\n\t\t\t})\n\n\t\t\t// set the chart svg height to the children height\n\t\t\t// forcing the chart not to take up any more space than it requires\n\t\t\tchildrenHeight <= chartHeight\n\t\t\t\t? select(this.mainContainer).attr('height', childrenHeight)\n\t\t\t\t: select(this.mainContainer).attr('height', '100%')\n\t\t}\n\t}\n\n\tgetMainContainer() {\n\t\treturn this.mainContainer\n\t}\n\n\taddHolderListeners() {\n\t\tconst holder = this.getHolder()\n\n\t\tif (!holder) {\n\t\t\treturn\n\t\t}\n\n\t\tselect(holder)\n\t\t\t.on('mouseover', () => {\n\t\t\t\t// Dispatch event\n\t\t\t\tthis.services.events?.dispatchEvent(Events.Chart.MOUSEOVER)\n\t\t\t})\n\t\t\t.on('mouseout', () => {\n\t\t\t\t// Dispatch event\n\t\t\t\tthis.services.events?.dispatchEvent(Events.Chart.MOUSEOUT)\n\t\t\t})\n\t}\n\n\taddResizeListener() {\n\t\tconst holder = this.getHolder()\n\n\t\tif (!holder) {\n\t\t\treturn\n\t\t}\n\n\t\t// Grab current dimensions of the chart holder\n\t\tlet containerWidth = holder.clientWidth\n\t\tlet containerHeight = holder.clientHeight\n\n\t\t// The resize callback function\n\t\tconst resizeCallback = debounce(() => {\n\t\t\tif (!holder) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tMath.abs(containerWidth - holder.clientWidth) > 1 ||\n\t\t\t\tMath.abs(containerHeight - holder.clientHeight) > 1\n\t\t\t) {\n\t\t\t\tcontainerWidth = holder.clientWidth\n\t\t\t\tcontainerHeight = holder.clientHeight\n\n\t\t\t\tthis.services.events?.dispatchEvent(Events.Chart.RESIZE)\n\t\t\t}\n\t\t}, 12.5)\n\n\t\t// Observe the behaviour of resizing on the holder\n\t\tconst resizeObserver = new ResizeObserver(resizeCallback)\n\t\tresizeObserver.observe(holder)\n\t}\n}\n","import { select, type Selection as D3Selection } from 'd3'\nimport { merge } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { carbonPrefix } from '@/configuration-non-customizable' // CSS prefix\nimport type { ChartModel } from '@/model/model'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { RenderTypes } from '@/interfaces/enums'\nimport { Services } from '@/interfaces/services'\n\nexport class Component {\n\tpublic type = ''\n\tpublic renderType = RenderTypes.HTML\n\n\tpublic id = ''\n\n\tprotected parent:\n\t\t| D3Selection<SVGGraphicsElement | HTMLDivElement, any, HTMLElement, any>\n\t\t| undefined = undefined\n\n\tprotected configs: any = {}\n\n\tprotected model: ChartModel\n\tprotected services: Services\n\n\tconstructor(model: ChartModel, services: Services, configs?: any) {\n\t\tthis.model = model\n\t\tthis.services = services\n\n\t\tif (configs) {\n\t\t\tthis.configs = configs\n\t\t\tif (this.configs.id) {\n\t\t\t\tconst chartprefix = getProperty(this.model.getOptions(), 'style', 'prefix')\n\t\t\t\tthis.id = `${chartprefix}--${this.configs.id}`\n\t\t\t}\n\t\t}\n\n\t\t// Set parent element to shell SVG if no parent exists for component\n\t\tif (!this.parent) {\n\t\t\tthis.setParent(\n\t\t\t\tselect<SVGGraphicsElement | HTMLDivElement, any>(\n\t\t\t\t\tthis.services.domUtils.getMainContainer() as HTMLDivElement\n\t\t\t\t)\n\t\t\t)\n\t\t}\n\t}\n\n\tinit() {\n\t\t// do nothing.\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true): void {\n\t\tconsole.error('Error: Component did not provide the required render function.')\n\t}\n\n\tdestroy() {\n\t\t// do nothing.\n\t}\n\n\t// Used to pass down information to the components\n\tsetModel(newObj: any) {\n\t\tthis.model = newObj\n\t}\n\n\t// Used to pass down information to the components\n\tsetServices(newObj: any) {\n\t\tthis.services = newObj\n\t}\n\n\tsetParent(parent: any) {\n\t\tconst oldParent = this.parent\n\t\tthis.parent = parent\n\n\t\tif (oldParent && oldParent.node() === parent.node()) {\n\t\t\treturn\n\t\t}\n\n\t\tif (this.type) {\n\t\t\tconst chartprefix = getProperty(this.model.getOptions(), 'style', 'prefix')\n\t\t\tthis.parent?.classed(`${carbonPrefix}--${chartprefix}--${this.type}`, true)\n\n\t\t\tif (oldParent) {\n\t\t\t\toldParent.classed(`${carbonPrefix}--${chartprefix}--${this.type}`, false)\n\t\t\t}\n\t\t}\n\t}\n\n\tgetParent() {\n\t\treturn this.parent\n\t}\n\n\tgetComponentContainer(configs = { withinChartClip: false }) {\n\t\tif (this.type) {\n\t\t\tconst chartprefix = getProperty(this.model.getOptions(), 'style', 'prefix')\n\n\t\t\tconst idSelector = this.id ? `#${this.id}` : ''\n\t\t\tconst container = DOMUtils.appendOrSelect(\n\t\t\t\tthis.parent,\n\t\t\t\t`${\n\t\t\t\t\tthis.renderType === RenderTypes.SVG ? 'svg' : 'div'\n\t\t\t\t}${idSelector}.${carbonPrefix}--${chartprefix}--${this.type}`\n\t\t\t)\n\n\t\t\tif (configs.withinChartClip) {\n\t\t\t\t// get unique chartClipId int this chart from model\n\t\t\t\tconst chartClipId = this.model.get('chartClipId')\n\n\t\t\t\tif (chartClipId) {\n\t\t\t\t\tconst chartClipSelection = select(`#${chartClipId}`)\n\t\t\t\t\tconst chartClipRectSelection = chartClipSelection.select('rect')\n\n\t\t\t\t\t/*\n\t\t\t\t\t * these checks are needed because of a chrome bug\n\t\t\t\t\t * related to the rendering of the clip path\n\t\t\t\t\t */\n\t\t\t\t\tif (\n\t\t\t\t\t\tchartClipRectSelection.size() !== 0 &&\n\t\t\t\t\t\tparseFloat(chartClipRectSelection.attr('height')) > 0\n\t\t\t\t\t) {\n\t\t\t\t\t\tcontainer.attr('clip-path', `url(#${chartClipId})`)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn container.attr('width', '100%').attr('height', '100%')\n\t\t}\n\t\treturn this.parent\n\t}\n\n\t/**\n\t * graphs used in combo charts share a model with global options but can receive their own local options.\n\t * this function retrieves the global options and merges it with any options passed into this\n\t * component's config.options object.\n\t */\n\tgetOptions() {\n\t\tif (this.configs.options) {\n\t\t\tconst options = merge({}, this.model.getOptions(), this.configs.options)\n\t\t\treturn options\n\t\t}\n\t\treturn this.model.getOptions()\n\t}\n}\n","/*! @license DOMPurify 3.0.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.8/LICENSE */\n\nconst {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor\n} = Object;\nlet {\n freeze,\n seal,\n create\n} = Object; // eslint-disable-line import/no-mutable-exports\nlet {\n apply,\n construct\n} = typeof Reflect !== 'undefined' && Reflect;\nif (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n}\nif (!seal) {\n seal = function seal(x) {\n return x;\n };\n}\nif (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n}\nif (!construct) {\n construct = function construct(Func, args) {\n return new Func(...args);\n };\n}\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\nconst regExpTest = unapply(RegExp.prototype.test);\nconst typeErrorCreate = unconstruct(TypeError);\n\n/**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param {Function} func - The function to be wrapped and called.\n * @returns {Function} A new function that calls the given function with a specified thisArg and arguments.\n */\nfunction unapply(func) {\n return function (thisArg) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return apply(func, thisArg, args);\n };\n}\n\n/**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param {Function} func - The constructor function to be wrapped and called.\n * @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments.\n */\nfunction unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return construct(func, args);\n };\n}\n\n/**\n * Add properties to a lookup table\n *\n * @param {Object} set - The set to which elements will be added.\n * @param {Array} array - The array containing elements to be added to the set.\n * @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns {Object} The modified set with added elements.\n */\nfunction addToSet(set, array) {\n let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n element = lcElement;\n }\n }\n set[element] = true;\n }\n return set;\n}\n\n/**\n * Clean up an array to harden against CSPP\n *\n * @param {Array} array - The array to be cleaned.\n * @returns {Array} The cleaned version of the array\n */\nfunction cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n if (getOwnPropertyDescriptor(array, index) === undefined) {\n array[index] = null;\n }\n }\n return array;\n}\n\n/**\n * Shallow clone an object\n *\n * @param {Object} object - The object to be cloned.\n * @returns {Object} A new object that copies the original.\n */\nfunction clone(object) {\n const newObject = create(null);\n for (const [property, value] of entries(object)) {\n if (getOwnPropertyDescriptor(object, property) !== undefined) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (value && typeof value === 'object' && value.constructor === Object) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n return newObject;\n}\n\n/**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param {Object} object - The object to look up the getter function in its prototype chain.\n * @param {String} prop - The property name for which to find the getter function.\n * @returns {Function} The getter function found in the prototype chain or a fallback function.\n */\nfunction lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n object = getPrototypeOf(object);\n }\n function fallbackValue(element) {\n console.warn('fallback value for', element);\n return null;\n }\n return fallbackValue;\n}\n\nconst html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\n\n// SVG\nconst svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\nconst svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nconst svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\nconst mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);\n\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nconst mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\nconst text = freeze(['#text']);\n\nconst html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns', 'slot']);\nconst svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\nconst mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\nconst xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n// eslint-disable-next-line unicorn/better-regex\nconst MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\nconst ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\nconst TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\nconst DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\nconst ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nconst IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\n\nconst IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nconst ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\n\nconst DOCTYPE_NAME = seal(/^html$/i);\n\nvar EXPRESSIONS = /*#__PURE__*/Object.freeze({\n __proto__: null,\n MUSTACHE_EXPR: MUSTACHE_EXPR,\n ERB_EXPR: ERB_EXPR,\n TMPLIT_EXPR: TMPLIT_EXPR,\n DATA_ATTR: DATA_ATTR,\n ARIA_ATTR: ARIA_ATTR,\n IS_ALLOWED_URI: IS_ALLOWED_URI,\n IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE: ATTR_WHITESPACE,\n DOCTYPE_NAME: DOCTYPE_NAME\n});\n\nconst getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n};\n\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\nconst _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n};\nfunction createDOMPurify() {\n let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n const DOMPurify = root => createDOMPurify(root);\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = '3.0.8';\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n if (!window || !window.document || window.document.nodeType !== 9) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n return DOMPurify;\n }\n let {\n document\n } = window;\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes\n } = window;\n const ElementPrototype = Element.prototype;\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n let trustedTypesPolicy;\n let emptyHTML = '';\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName\n } = document;\n const {\n importNode\n } = originalDocument;\n let hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE\n } = EXPRESSIONS;\n let {\n IS_ALLOWED_URI: IS_ALLOWED_URI$1\n } = EXPRESSIONS;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n\n /*\n * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false\n }\n }));\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n\n /* Decide if document with <html>... should be returned */\n let WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n const formElement = document.createElement('form');\n const isRegexOrFunction = function isRegexOrFunction(testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function _parseConfig() {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n\n /* Set configuration parameters */\n ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = 'ALLOWED_NAMESPACES' in cfg ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES),\n // eslint-disable-line indent\n cfg.ADD_URI_SAFE_ATTR,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS),\n // eslint-disable-line indent\n cfg.ADD_DATA_URI_TAGS,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = 'FORBID_CONTENTS' in cfg ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};\n FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};\n USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, text);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html$1);\n addToSet(ALLOWED_ATTR, html);\n }\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg$1);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl$1);\n addToSet(ALLOWED_ATTR, mathMl);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n }\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n }\n\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n }\n\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n CONFIG = cfg;\n };\n const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']);\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);\n const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n\n /**\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function _checkValidNamespace(element) {\n let parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template'\n };\n }\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via <svg>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either <annotation-xml> or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via <math>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n\n // The only way to switch from SVG to MathML is via\n // <math> and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n }\n\n // For XHTML and XML documents that support custom namespaces\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n return true;\n }\n\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n const _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, {\n element: node\n });\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n node.parentNode.removeChild(node);\n } catch (_) {\n node.remove();\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n const _removeAttribute = function _removeAttribute(name, node) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: node.getAttributeNode(name),\n from: node\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: node\n });\n }\n node.removeAttribute(name);\n\n // We void attribute values for unremovable \"is\"\" attributes\n if (name === 'is' && !ALLOWED_ATTR[name]) {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(node);\n } catch (_) {}\n } else {\n try {\n node.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n const _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n if (FORCE_BODY) {\n dirty = '<remove></remove>' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty = '<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>' + dirty + '</body></html>';\n }\n const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n const body = doc.body || doc.documentElement;\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param {Node} root The root element or node to start traversing on.\n * @return {NodeIterator} The created NodeIterator\n */\n const _createNodeIterator = function _createNodeIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, null);\n };\n\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n const _isClobbered = function _isClobbered(elm) {\n return elm instanceof HTMLFormElement && (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function');\n };\n\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param {Node} object object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n const _isNode = function _isNode(object) {\n return typeof Node === 'function' && object instanceof Node;\n };\n\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n const _executeHook = function _executeHook(entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n arrayForEach(hooks[entryPoint], hook => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n const _sanitizeElements = function _sanitizeElements(currentNode) {\n let content = null;\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeElements', currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n\n /* Execute a hook if present */\n _executeHook('uponSanitizeElement', currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS\n });\n\n /* Detect mXSS attempts abusing namespace confusion */\n if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {\n return false;\n }\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {\n return false;\n }\n }\n\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n for (let i = childCount - 1; i >= 0; --i) {\n parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));\n }\n }\n }\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {\n /* Get the element's text content */\n content = currentNode.textContent;\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n content = stringReplace(content, expr, ' ');\n });\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, {\n element: currentNode.cloneNode()\n });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeElements', currentNode, null);\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {\n return false;\n } else ;\n return true;\n };\n\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param {string} tagName name of the tag of the node to sanitize\n * @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n return tagName.indexOf('-') > 0;\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} currentNode to sanitize\n */\n const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n /* Execute a hook if present */\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n const {\n attributes\n } = currentNode;\n\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes) {\n return;\n }\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR\n };\n let l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const {\n name,\n namespaceURI,\n value: attrValue\n } = attr;\n const lcName = transformCaseFunc(name);\n let value = name === 'value' ? attrValue : stringTrim(attrValue);\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n value = stringReplace(value, expr, ' ');\n });\n }\n\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n\n /* Handle attributes that require Trusted Types */\n if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {\n if (namespaceURI) ; else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML':\n {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n case 'TrustedScriptURL':\n {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n }\n }\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n arrayPop(DOMPurify.removed);\n } catch (_) {}\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(shadowNode);\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} cfg object\n */\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty) {\n let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '<!-->';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('<!---->');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while (currentNode = nodeIterator.nextNode()) {\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n }\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n return returnNode;\n }\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Serialize doctype if allowed */\n if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\\n' + serializedHTML;\n }\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function () {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {String} tag Tag name of containing element.\n * @param {String} attr Attribute name.\n * @param {String} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n hooks[entryPoint] = hooks[entryPoint] || [];\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n * @return {Function} removed(popped) hook\n */\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n return arrayPop(hooks[entryPoint]);\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n */\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n return DOMPurify;\n}\nvar purify = createDOMPurify();\n\nexport { purify as default };\n//# sourceMappingURL=purify.es.mjs.map\n","import DOMPurify from 'dompurify'\n\nexport const sanitizeHtml = (html: string) => {\n\treturn DOMPurify.sanitize(html, {\n\t\tUSE_PROFILES: {\n\t\t\thtml: true,\n\t\t\tsvg: true,\n\t\t\tsvgFilters: true\n\t\t}\n\t})\n}\n\n// This is a more restrictive version of sanitizeHtml that focuses on SVGs\nexport const sanitizeSVG = (svgContent: string) => {\n\treturn DOMPurify.sanitize(svgContent, {\n\t\tNAMESPACE: 'http://www.w3.org/2000/svg',\n\t\tUSE_PROFILES: {\n\t\t\thtml: true,\n\t\t\tsvg: true,\n\t\t\tsvgFilters: true\n\t\t}\n\t})\n}\n\n// This is a more restrictive version of sanitizeHtml that only allows text\nexport const sanitizeText = (html: string) => {\n\treturn DOMPurify.sanitize(html, { ALLOWED_TAGS: [] })\n}\n","import { select } from 'd3'\nimport { getProperty } from '@/tools'\nimport { Component } from '@/components/component'\nimport { Events, RenderTypes, ToolbarControlTypes } from '@/interfaces/enums'\nimport { sanitizeSVG, sanitizeText } from '@/utils/sanitizeHtml'\n\nexport class Toolbar extends Component {\n\tstatic buttonID = 0\n\ttype = 'toolbar'\n\trenderType = RenderTypes.HTML\n\n\t// overflow menu button to control background color\n\toverflowButton: any\n\n\t// div options list element\n\toverflowMenu: any\n\n\tinit() {\n\t\tconst bodyOnClickHandler = () => this.updateOverflowMenu(false)\n\n\t\t// Grab the tooltip element\n\t\tthis.services.events.addEventListener(Events.Toolbar.SHOW_OVERFLOW_MENU, () => {\n\t\t\tthis.renderOverflowMenu()\n\n\t\t\t// hide overflow menu if user clicks on somewhere in web page\n\t\t\tdocument.body.addEventListener('click', bodyOnClickHandler)\n\t\t})\n\n\t\t// listen to hide overflow menu event to hide the overflow menu\n\t\tthis.services.events.addEventListener(Events.Toolbar.HIDE_OVERFLOW_MENU, () => {\n\t\t\t// // hide overflow menu if user clicks on somewhere in web page\n\t\t\tdocument.body.removeEventListener('click', bodyOnClickHandler)\n\t\t})\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\tconst container = this.getComponentContainer()\n\t\t\t.attr('role', 'toolbar')\n\t\t\t.attr('aria-label', `chart-${this.services.domUtils.getChartID()} toolbar`)\n\n\t\tconst isDataLoading = getProperty(this.getOptions(), 'data', 'loading')\n\n\t\tif (isDataLoading) {\n\t\t\tcontainer.html('')\n\t\t\t// Set overflow menu to null if data is loading\n\t\t\t// This will render in a new overflow menu when data is done loading\n\t\t\tthis.overflowMenu = null\n\t\t} else {\n\t\t\tif (!this.overflowMenu) {\n\t\t\t\tthis.overflowMenu = container\n\t\t\t\t\t.append('div')\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'class',\n\t\t\t\t\t\t'cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip'\n\t\t\t\t\t)\n\t\t\t\t\t.attr('tabindex', -1)\n\t\t\t\t\t.html(`<ul role='menu'></ul>`)\n\t\t\t}\n\n\t\t\t// get the toolbar buttons\n\t\t\tconst { buttonList, overflowMenuItemList } = this.getControlConfigs()\n\n\t\t\t// overflow button is required only if overflow menu item list is valid\n\t\t\tif (overflowMenuItemList) {\n\t\t\t\tbuttonList.push(this.getOverflowButtonConfig())\n\t\t\t}\n\n\t\t\tconst toolbarControls = container\n\t\t\t\t.selectAll('div.toolbar-control')\n\t\t\t\t.data(buttonList, (button: any) => button.id)\n\n\t\t\ttoolbarControls.exit().remove()\n\n\t\t\tconst enteringToolbarControls = toolbarControls\n\t\t\t\t.enter()\n\t\t\t\t.append('div')\n\t\t\t\t.attr('class', 'toolbar-control cds--overflow-menu cds--overflow-menu')\n\n\t\t\tconst self = this\n\t\t\tenteringToolbarControls\n\t\t\t\t.merge(toolbarControls as any)\n\t\t\t\t.classed('disabled', (d: any) => d.shouldBeDisabled())\n\t\t\t\t.attr('aria-disabled', (d: any) => d.shouldBeDisabled())\n\t\t\t\t.attr('aria-label', (d: any) => d.title)\n\t\t\t\t.html((d: any) => {\n\t\t\t\t\treturn `\n\t\t\t<button\n\t\t\t\tclass=\"cds--overflow-menu__trigger cds--overflow-menu__trigger\"\n\t\t\t\taria-haspopup=\"true\" aria-expanded=\"false\" id=\"${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${sanitizeText(d.id)}`\n\t\t\t\t)}\" aria-label=\"${sanitizeText(d.title)}\">\n\t\t\t\t<svg focusable=\"false\" preserveAspectRatio=\"xMidYMid meet\" xmlns=\"http://www.w3.org/2000/svg\" class=\"cds--overflow-menu__icon cds--overflow-menu__icon\" viewBox=\"0 0 32 32\" aria-hidden=\"true\">\n\t\t\t\t\t${sanitizeSVG(d.iconSVG.content)}\n\t\t\t\t</svg>\n\t\t\t</button>`\n\t\t\t\t})\n\t\t\t\t.each(function (d: any, index: number) {\n\t\t\t\t\tselect(this)\n\t\t\t\t\t\t.select('svg')\n\t\t\t\t\t\t.style('will-change', 'transform')\n\t\t\t\t\t\t.style('width', d.iconSVG.width !== undefined ? d.iconSVG.width : '20px')\n\t\t\t\t\t\t.style('height', d.iconSVG.height !== undefined ? d.iconSVG.height : '20px')\n\n\t\t\t\t\tselect(this)\n\t\t\t\t\t\t.select('button')\n\t\t\t\t\t\t.on('click', (event: CustomEvent<MouseEvent>) => {\n\t\t\t\t\t\t\tif (!d.shouldBeDisabled()) {\n\t\t\t\t\t\t\t\tself.triggerFunctionAndEvent(d, event, this)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.on('keydown', (event: any) => {\n\t\t\t\t\t\t\tif ((event.key && event.key === 'Enter') || event.key === ' ') {\n\t\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\t\tself.triggerFunctionAndEvent(d, event, this)\n\t\t\t\t\t\t\t} else if (event.key && event.key === 'ArrowLeft') {\n\t\t\t\t\t\t\t\tself.focusOnPreviousEnabledToolbarItem(index)\n\t\t\t\t\t\t\t} else if (event.key && event.key === 'ArrowRight') {\n\t\t\t\t\t\t\t\tself.focusOnNextEnabledToolbarItem(index)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\tthis.overflowButton = this.getComponentContainer().select(\n\t\t\t\t`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t'control-toolbar-overflow-menu'\n\t\t\t\t)}`\n\t\t\t)\n\t\t}\n\t}\n\n\trenderOverflowMenu() {\n\t\tconst { overflowMenuItemList } = this.getControlConfigs()\n\n\t\tconst overflowMenuControls = this.overflowMenu\n\t\t\t.select('ul')\n\t\t\t.selectAll('li.cds--overflow-menu-options__option')\n\t\t\t.data(overflowMenuItemList, (button: any) => getProperty(button, 'id'))\n\n\t\toverflowMenuControls.exit().remove()\n\n\t\tconst enteringOverflowMenuControls = overflowMenuControls\n\t\t\t.enter()\n\t\t\t.append('li')\n\t\t\t.attr('id', (d: any) => this.services.domUtils.generateElementIDString(`control-${d.id}`))\n\t\t\t.attr('class', 'cds--overflow-menu-options__option cds--overflow-menu-options__option')\n\t\t\t.attr('role', 'menuitem')\n\t\t\t.attr('tabindex', 1)\n\n\t\tenteringOverflowMenuControls\n\t\t\t.append('button')\n\t\t\t.attr('class', 'cds--overflow-menu-options__btn cds--overflow-menu-options__btn')\n\n\t\tenteringOverflowMenuControls\n\t\t\t.merge(overflowMenuControls)\n\t\t\t.classed('cds--overflow-menu-options__option--disabled', (d: any) => d.shouldBeDisabled())\n\t\t\t.classed('cds--overflow-menu-options__option--disabled', (d: any) => d.shouldBeDisabled())\n\t\t\t.attr('aria-disabled', (d: any) => d.shouldBeDisabled())\n\t\t\t.selectAll('button')\n\t\t\t.text((d: any) => d.text)\n\t}\n\n\tisOverflowMenuOpen() {\n\t\treturn this.overflowMenu.classed('is-open')\n\t}\n\n\t// show/hide overflow menu\n\tupdateOverflowMenu(show: boolean) {\n\t\tif (!this.overflowMenu) {\n\t\t\treturn\n\t\t}\n\t\tthis.overflowMenu.classed('is-open', show)\n\n\t\t// update overflow button background\n\t\tif (this.overflowButton) {\n\t\t\tthis.overflowButton.attr('aria-expanded', show)\n\t\t\tselect(this.overflowButton.node().parentNode)\n\t\t\t\t.classed('cds--overflow-menu--open', show)\n\t\t\t\t.classed('cds--overflow-menu--open', show)\n\t\t}\n\n\t\tif (show) {\n\t\t\tthis.services.events.dispatchEvent(Events.Toolbar.SHOW_OVERFLOW_MENU)\n\t\t} else {\n\t\t\tthis.services.events.dispatchEvent(Events.Toolbar.HIDE_OVERFLOW_MENU)\n\t\t}\n\t}\n\n\t// Toolbar controllers\n\tfocusOnPreviousEnabledToolbarItem(currentItemIndex: number) {\n\t\tconst buttonList = this.getToolbarButtonItems()\n\t\tlet previousItemIndex = buttonList.length\n\n\t\tfor (let i = currentItemIndex - 1; i >= 0; i--) {\n\t\t\tconst previousButtonItem = buttonList[i]\n\t\t\tif (!previousButtonItem.shouldBeDisabled()) {\n\t\t\t\tpreviousItemIndex = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t// only if previous enabled menu item found\n\t\tif (previousItemIndex < buttonList.length) {\n\t\t\tconst previousItemNode = select(\n\t\t\t\t`button#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${buttonList[previousItemIndex].id}`\n\t\t\t\t)}`\n\t\t\t).node()\n\t\t\tif ('focus' in previousItemNode) {\n\t\t\t\tpreviousItemNode.focus()\n\t\t\t}\n\t\t}\n\t}\n\n\tfocusOnNextEnabledToolbarItem(currentItemIndex: number) {\n\t\tconst buttonList = this.getToolbarButtonItems()\n\t\tlet nextItemIndex = -1\n\n\t\tfor (let i = currentItemIndex + 1; i < buttonList.length; i++) {\n\t\t\tconst nextOverflowMenuItem = buttonList[i]\n\t\t\tif (!nextOverflowMenuItem.shouldBeDisabled()) {\n\t\t\t\tnextItemIndex = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t// only if next enabled menu item found\n\t\tif (nextItemIndex > -1) {\n\t\t\tconst nextItemNode = select(\n\t\t\t\t`button#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${buttonList[nextItemIndex].id}`\n\t\t\t\t)}`\n\t\t\t).node()\n\n\t\t\tif ('focus' in nextItemNode) {\n\t\t\t\tnextItemNode.focus()\n\t\t\t}\n\t\t}\n\t}\n\n\tfocusOnPreviousEnabledMenuItem(currentItemIndex: number) {\n\t\tconst overflowMenuItems = this.getOverflowMenuItems()\n\t\tlet previousItemIndex = overflowMenuItems.length\n\n\t\tfor (let i = currentItemIndex - 1; i >= 0; i--) {\n\t\t\tconst previousOverflowMenuItem = overflowMenuItems[i]\n\t\t\tif (!previousOverflowMenuItem.shouldBeDisabled()) {\n\t\t\t\tpreviousItemIndex = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t// only if previous enabled menu item found\n\t\tif (previousItemIndex < overflowMenuItems.length) {\n\t\t\tconst previousItemNode = select(\n\t\t\t\t`#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${overflowMenuItems[previousItemIndex].id}`\n\t\t\t\t)} button`\n\t\t\t).node()\n\t\t\tif ('focus' in previousItemNode) {\n\t\t\t\tpreviousItemNode.focus()\n\t\t\t}\n\t\t}\n\t}\n\n\tfocusOnNextEnabledMenuItem(currentItemIndex: number) {\n\t\tconst overflowMenuItems = this.getOverflowMenuItems()\n\t\tlet nextItemIndex = -1\n\n\t\tfor (let i = currentItemIndex + 1; i < overflowMenuItems.length; i++) {\n\t\t\tconst nextOverflowMenuItem = overflowMenuItems[i]\n\t\t\tif (!nextOverflowMenuItem.shouldBeDisabled()) {\n\t\t\t\tnextItemIndex = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t// only if next enabled menu item found\n\t\tif (nextItemIndex > -1) {\n\t\t\tconst nextItemNode = select(\n\t\t\t\t`#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${overflowMenuItems[nextItemIndex].id}`\n\t\t\t\t)} button`\n\t\t\t).node()\n\n\t\t\tif ('focus' in nextItemNode) {\n\t\t\t\tnextItemNode.focus()\n\t\t\t}\n\t\t}\n\t}\n\n\ttoggleOverflowMenu(event: any) {\n\t\tif (this.isOverflowMenuOpen()) {\n\t\t\t// hide overflow menu\n\t\t\tthis.updateOverflowMenu(false)\n\t\t} else {\n\t\t\t// show overflow menu\n\t\t\tthis.updateOverflowMenu(true)\n\n\t\t\t// setup overflow menu item event listener\n\t\t\tconst self = this\n\t\t\tconst overflowMenuItems = this.getOverflowMenuItems()\n\t\t\toverflowMenuItems.forEach((menuItem: any, index) => {\n\t\t\t\tconst element = select(\n\t\t\t\t\t`#${this.services.domUtils.generateElementIDString(`control-${menuItem.id}`)}`\n\t\t\t\t)\n\t\t\t\tif (element !== null) {\n\t\t\t\t\telement.on('click', () => {\n\t\t\t\t\t\tself.triggerFunctionAndEvent(menuItem, event, element.node())\n\n\t\t\t\t\t\t// hide overflow menu\n\t\t\t\t\t\tself.updateOverflowMenu(false)\n\t\t\t\t\t})\n\n\t\t\t\t\telement.on('keydown', (keyEvent: KeyboardEvent) => {\n\t\t\t\t\t\tif (keyEvent && keyEvent.key === 'Enter') {\n\t\t\t\t\t\t\tself.triggerFunctionAndEvent(menuItem, event, element.node())\n\t\t\t\t\t\t} else if (keyEvent && keyEvent.key === 'ArrowUp') {\n\t\t\t\t\t\t\t// focus on previous menu item\n\t\t\t\t\t\t\tself.focusOnPreviousEnabledMenuItem(index)\n\t\t\t\t\t\t} else if (keyEvent && keyEvent.key === 'ArrowDown') {\n\t\t\t\t\t\t\t// focus on next menu item\n\t\t\t\t\t\t\tself.focusOnNextEnabledMenuItem(index)\n\t\t\t\t\t\t} else if (keyEvent && keyEvent.key === 'Escape') {\n\t\t\t\t\t\t\tself.updateOverflowMenu(false)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Not hide overflow menu by keyboard arrow up/down event\n\t\t\t\t\t\t// Prevent page from scrolling up/down\n\t\t\t\t\t\tkeyEvent.preventDefault()\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\n\t\t\t// default to focus on the first enabled menu item\n\t\t\tself.focusOnNextEnabledMenuItem(-1)\n\t\t}\n\n\t\t// propogation should not be stopped for keyboard events\n\t\tif (event) {\n\t\t\tevent.stopImmediatePropagation()\n\t\t}\n\t}\n\n\t// Calls passed function && dispatches event\n\ttriggerFunctionAndEvent(control: any, event: CustomEvent, element?: any) {\n\t\t// Check if trigger is disabled\n\t\tif (typeof control.shouldBeDisabled === 'function' && control.shouldBeDisabled()) {\n\t\t\treturn\n\t\t}\n\n\t\t// Call custom function only if it exists\n\t\tif (typeof control.clickFunction === 'function') {\n\t\t\tcontrol.clickFunction(event)\n\t\t}\n\n\t\t// Dispatch selection event\n\t\tthis.services.events.dispatchEvent(Events.Toolbar.BUTTON_CLICK, {\n\t\t\tcontrol,\n\t\t\tevent,\n\t\t\telement\n\t\t})\n\t}\n\n\tgetControlConfigs() {\n\t\tconst numberOfIcons = getProperty(this.getOptions(), 'toolbar', 'numberOfIcons') - 1\n\t\tconst controls = getProperty(this.getOptions(), 'toolbar', 'controls')\n\n\t\tconst overflowSpecificControls: any[] = []\n\t\tconst buttonList: any[] = []\n\t\tconst overflowList: any[] = []\n\n\t\tcontrols.forEach((control: any) => {\n\t\t\tlet controlConfig = null\n\t\t\t// check if button is custom or default control\n\t\t\tif (control.type === ToolbarControlTypes.CUSTOM) {\n\t\t\t\t// add generic id if missing\n\t\t\t\tif (getProperty(control, 'id') === null) {\n\t\t\t\t\t// add id directly to the data passed so that id isn't reassigned on rerender\n\t\t\t\t\tcontrol.id = `toolbar-button-${Toolbar.buttonID++}`\n\t\t\t\t}\n\t\t\t\t// define function if missing\n\t\t\t\tif (getProperty(control, 'shouldBeDisabled') === null) {\n\t\t\t\t\tcontrol.shouldBeDisabled = () => false\n\t\t\t\t}\n\n\t\t\t\tcontrolConfig = control\n\t\t\t} else {\n\t\t\t\tcontrolConfig = this.getControlConfigByType(control.type)\n\t\t\t}\n\n\t\t\t// add to list if config is valid\n\t\t\tif (controlConfig) {\n\t\t\t\tcontrolConfig.text = control.text ? control.text : control.type\n\n\t\t\t\tif (controlConfig.id.indexOf('toolbar-export') !== -1) {\n\t\t\t\t\toverflowSpecificControls.push(controlConfig)\n\t\t\t\t} else if (buttonList.length < numberOfIcons) {\n\t\t\t\t\t// check if icon exists else assign to the overflow list\n\t\t\t\t\tif (getProperty(controlConfig, 'iconSVG', 'content') === null) {\n\t\t\t\t\t\toverflowList.push(controlConfig)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbuttonList.push(controlConfig)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toverflowList.push(controlConfig)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\t// Ensures the `export` controls are always at the bottom\n\t\toverflowList.push(...overflowSpecificControls)\n\n\t\tif (!overflowList.length) {\n\t\t\treturn {\n\t\t\t\tbuttonList\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tbuttonList,\n\t\t\toverflowMenuItemList: overflowList\n\t\t}\n\t}\n\n\tgetToolbarButtonItems() {\n\t\tconst { buttonList, overflowMenuItemList } = this.getControlConfigs()\n\t\tif (overflowMenuItemList) {\n\t\t\tbuttonList.push(this.getOverflowButtonConfig())\n\t\t}\n\t\tif (buttonList) {\n\t\t\treturn buttonList\n\t\t}\n\n\t\treturn []\n\t}\n\n\tgetOverflowMenuItems() {\n\t\tconst { overflowMenuItemList } = this.getControlConfigs()\n\t\tif (overflowMenuItemList) {\n\t\t\treturn overflowMenuItemList\n\t\t} else {\n\t\t\treturn []\n\t\t}\n\t}\n\n\t// special button config for overflow button\n\tgetOverflowButtonConfig() {\n\t\treturn {\n\t\t\tid: 'toolbar-overflow-menu',\n\t\t\ttitle: 'More options',\n\t\t\tshouldBeDisabled: () => false,\n\t\t\ticonSVG: {\n\t\t\t\tcontent: `<circle cx=\"16\" cy=\"8\" r=\"2\"></circle>\n\t\t\t\t<circle cx=\"16\" cy=\"16\" r=\"2\"></circle>\n\t\t\t\t<circle cx=\"16\" cy=\"24\" r=\"2\"></circle>`\n\t\t\t},\n\t\t\tclickFunction: (event: any) => this.toggleOverflowMenu(event)\n\t\t}\n\t}\n\n\tgetControlConfigByType(controlType: ToolbarControlTypes) {\n\t\tconst isZoomBarEnabled =\n\t\t\tthis.services.zoom &&\n\t\t\tthis.services.zoom.isZoomBarEnabled() &&\n\t\t\t!this.services.zoom.isEmptyState()\n\n\t\tconst displayData = this.model.getDisplayData()\n\n\t\tlet controlConfig: any\n\t\tswitch (controlType) {\n\t\t\tcase ToolbarControlTypes.ZOOM_IN:\n\t\t\t\tif (isZoomBarEnabled) {\n\t\t\t\t\tcontrolConfig = {\n\t\t\t\t\t\tid: 'toolbar-zoomIn',\n\t\t\t\t\t\ttitle: 'Zoom in',\n\t\t\t\t\t\tshouldBeDisabled: () => this.services.zoom.isMinZoomDomain(),\n\t\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\t\tcontent: this.getControlIconByType(controlType)\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclickFunction: () => this.services.zoom.zoomIn()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase ToolbarControlTypes.ZOOM_OUT:\n\t\t\t\tif (isZoomBarEnabled) {\n\t\t\t\t\tcontrolConfig = {\n\t\t\t\t\t\tid: 'toolbar-zoomOut',\n\t\t\t\t\t\ttitle: 'Zoom out',\n\t\t\t\t\t\tshouldBeDisabled: () => this.services.zoom.isMaxZoomDomain(),\n\t\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\t\tcontent: this.getControlIconByType(controlType)\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclickFunction: () => this.services.zoom.zoomOut()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase ToolbarControlTypes.RESET_ZOOM:\n\t\t\t\tif (isZoomBarEnabled) {\n\t\t\t\t\tcontrolConfig = {\n\t\t\t\t\t\tid: 'toolbar-resetZoom',\n\t\t\t\t\t\ttitle: 'Reset zoom',\n\t\t\t\t\t\tshouldBeDisabled: () => this.services.zoom.isMaxZoomDomain(),\n\t\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\t\tcontent: this.getControlIconByType(controlType)\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclickFunction: () => this.services.zoom.resetZoomDomain()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase ToolbarControlTypes.MAKE_FULLSCREEN:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-makefullscreen',\n\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\tcontent: this.getControlIconByType(controlType),\n\t\t\t\t\t\twidth: '15px',\n\t\t\t\t\t\theight: '15px'\n\t\t\t\t\t},\n\t\t\t\t\ttitle: 'Make fullscreen',\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\tclickFunction: () => {\n\t\t\t\t\t\tthis.services.domUtils.toggleFullscreen()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase ToolbarControlTypes.SHOW_AS_DATATABLE:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-showasdatatable',\n\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\tcontent: this.getControlIconByType(controlType)\n\t\t\t\t\t},\n\t\t\t\t\ttitle: 'Show as table',\n\t\t\t\t\tshouldBeDisabled: () => displayData.length === 0,\n\t\t\t\t\tclickFunction: () => this.services.events.dispatchEvent(Events.Modal.SHOW)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase ToolbarControlTypes.EXPORT_CSV:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-export-CSV',\n\t\t\t\t\ttitle: 'Export as CSV',\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\tcontent: this.getControlIconByType(controlType)\n\t\t\t\t\t},\n\t\t\t\t\tclickFunction: () => this.model.exportToCSV()\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase ToolbarControlTypes.EXPORT_PNG:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-export-PNG',\n\t\t\t\t\ttitle: 'Export as PNG',\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\tcontent: this.getControlIconByType(controlType)\n\t\t\t\t\t},\n\t\t\t\t\tclickFunction: () => this.services.domUtils.exportToPNG()\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase ToolbarControlTypes.EXPORT_JPG:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-export-JPG',\n\t\t\t\t\ttitle: 'Export as JPG',\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\tcontent: this.getControlIconByType(controlType)\n\t\t\t\t\t},\n\t\t\t\t\tclickFunction: () => this.services.domUtils.exportToJPG()\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// add more toolbar control configuration here\n\n\t\t\tdefault:\n\t\t\t\tthrow Error('Not supported toolbar control type: ' + controlType)\n\t\t}\n\t\treturn controlConfig\n\t}\n\n\tgetControlIconByType(controlType: ToolbarControlTypes) {\n\t\tswitch (controlType) {\n\t\t\tcase ToolbarControlTypes.ZOOM_IN:\n\t\t\t\treturn `<polygon points=\"19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13\"/>\n\t\t\t\t\t\t<path d=\"M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z\"/>`\n\t\t\tcase ToolbarControlTypes.ZOOM_OUT:\n\t\t\t\treturn `<rect x=\"9\" y=\"13\" width=\"10\" height=\"2\"/>\n\t\t\t\t\t\t<path d=\"M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z\"/>`\n\t\t\tcase ToolbarControlTypes.RESET_ZOOM:\n\t\t\t\treturn `<path d=\"M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z\"/>`\n\t\t\tcase ToolbarControlTypes.MAKE_FULLSCREEN:\n\t\t\t\treturn `<polygon points=\"21 2 21 4 26.59 4 17 13.58 18.41 15 28 5.41 28 11 30 11 30 2 21 2\"/><polygon points=\"15 18.42 13.59 17 4 26.59 4 21 2 21 2 30 11 30 11 28 5.41 28 15 18.42\"/>`\n\t\t\tcase ToolbarControlTypes.SHOW_AS_DATATABLE:\n\t\t\t\treturn `<rect x=\"4\" y=\"6\" width=\"18\" height=\"2\"/><rect x=\"4\" y=\"12\" width=\"18\" height=\"2\"/><rect x=\"4\" y=\"18\" width=\"18\" height=\"2\"/><rect x=\"4\" y=\"24\" width=\"18\" height=\"2\"/><rect x=\"26\" y=\"6\" width=\"2\" height=\"2\"/><rect x=\"26\" y=\"12\" width=\"2\" height=\"2\"/><rect x=\"26\" y=\"18\" width=\"2\" height=\"2\"/><rect x=\"26\" y=\"24\" width=\"2\" height=\"2\"/>`\n\t\t\tcase ToolbarControlTypes.EXPORT_CSV:\n\t\t\t\treturn `<path d=\"M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z\"/>`\n\t\t\tcase ToolbarControlTypes.EXPORT_JPG:\n\t\t\t\treturn `<path d=\"M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z\"/>`\n\t\t\tcase ToolbarControlTypes.EXPORT_PNG:\n\t\t\t\treturn `<path d=\"M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z\"/>` // add more icons here\n\t\t\t// svg icon must be with 32x32 viewBox\n\n\t\t\tdefault:\n\t\t\t\tthrow Error('Not supported toolbar control type: ' + controlType)\n\t\t}\n\t}\n}\n","import { select } from 'd3'\nimport { getProperty } from '@/tools'\nimport { carbonPrefix } from '@/configuration-non-customizable' // CSS prefix\nimport { Component } from '@/components/component'\nimport { LayoutDirection, LayoutGrowth, RenderTypes, LayoutAlignItems } from '@/interfaces/enums'\nimport { LayoutConfigs } from '@/interfaces/layout'\nimport { LayoutComponentChild } from '@/interfaces/components'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport type { ChartModel } from '@/model/model'\n\nexport class LayoutComponent extends Component {\n\t// Give every layout component a distinct ID\n\t// so they don't interfere when querying elements\n\tstatic instanceID = Math.floor(Math.random() * 99999999999)\n\n\ttype = 'layout'\n\n\tchildren: LayoutComponentChild[]\n\n\tprivate _instanceID: number\n\n\tconstructor(\n\t\tmodel: ChartModel,\n\t\tservices: any,\n\t\tchildren: LayoutComponentChild[],\n\t\tconfigs?: LayoutConfigs\n\t) {\n\t\tsuper(model, services, configs)\n\n\t\tthis.configs = configs\n\t\tthis.children = children\n\n\t\tthis._instanceID = LayoutComponent.instanceID++\n\n\t\tthis.init()\n\t}\n\n\tinit() {\n\t\tthis.children.forEach((child: any) => {\n\t\t\tchild.components.forEach((component: Component) => {\n\t\t\t\tcomponent.init()\n\t\t\t})\n\t\t})\n\t}\n\n\tgetPreferedAndFixedSizeSum(): number {\n\t\tconst svg = this.parent\n\t\tlet sum = 0\n\n\t\tsvg\n\t\t\t.selectAll(`div.layout-child-${this._instanceID}`)\n\t\t\t.filter((d: any) => {\n\t\t\t\tconst growth = getProperty(d, 'growth')\n\n\t\t\t\treturn growth === LayoutGrowth.PREFERRED || growth === LayoutGrowth.FIXED\n\t\t\t})\n\t\t\t.each(function (d: any) {\n\t\t\t\tsum += d.size\n\t\t\t})\n\n\t\treturn sum\n\t}\n\n\tgetNumOfStretchChildren(): number {\n\t\tconst svg = this.parent\n\n\t\treturn svg\n\t\t\t.selectAll(`div.layout-child-${this._instanceID}`)\n\t\t\t.filter((d: any) => getProperty(d, 'growth') === LayoutGrowth.STRETCH)\n\t\t\t.size()\n\t}\n\n\trender(animate = true) {\n\t\t// Get parent element to render inside of\n\t\tconst parent = this.parent\n\n\t\tconst { width, height } = DOMUtils.getHTMLElementSize(parent.node() as any)\n\n\t\tconst horizontal =\n\t\t\tthis.configs.direction === LayoutDirection.ROW ||\n\t\t\tthis.configs.direction === LayoutDirection.ROW_REVERSE\n\n\t\tconst chartprefix = getProperty(this.model.getOptions(), 'style', 'prefix')\n\n\t\t// Add new boxes to the DOM for each layout child\n\t\tconst updatedBoxes = parent\n\t\t\t.classed(\n\t\t\t\t`${carbonPrefix}--${chartprefix}--layout-row`,\n\t\t\t\tthis.configs.direction === LayoutDirection.ROW\n\t\t\t)\n\t\t\t.classed(\n\t\t\t\t`${carbonPrefix}--${chartprefix}--layout-row-reverse`,\n\t\t\t\tthis.configs.direction === LayoutDirection.ROW_REVERSE\n\t\t\t)\n\t\t\t.classed(\n\t\t\t\t`${carbonPrefix}--${chartprefix}--layout-column`,\n\t\t\t\tthis.configs.direction === LayoutDirection.COLUMN\n\t\t\t)\n\t\t\t.classed(\n\t\t\t\t`${carbonPrefix}--${chartprefix}--layout-column-reverse`,\n\t\t\t\tthis.configs.direction === LayoutDirection.COLUMN_REVERSE\n\t\t\t)\n\t\t\t.classed(\n\t\t\t\t`${carbonPrefix}--${chartprefix}--layout-alignitems-center`,\n\t\t\t\tthis.configs.alignItems === LayoutAlignItems.CENTER\n\t\t\t)\n\t\t\t.selectAll(`div.layout-child-${this._instanceID}`)\n\t\t\t.data(this.children, (d: any) => d.id)\n\n\t\tconst enteringBoxes = updatedBoxes.enter().append('div')\n\n\t\tenteringBoxes\n\t\t\t.merge(parent.selectAll(`div.layout-child-${this._instanceID}`))\n\t\t\t.attr('class', (d: any) => `layout-child layout-child-${this._instanceID} ${d.id}`)\n\t\t\t.each(function (d: any) {\n\t\t\t\t// Set parent component for each child\n\t\t\t\td.components.forEach((itemComponent: any) => {\n\t\t\t\t\tconst selection = select(this)\n\n\t\t\t\t\tconst renderType = getProperty(d, 'renderType')\n\t\t\t\t\tconst isRenderingSVG = renderType === RenderTypes.SVG\n\t\t\t\t\titemComponent.setParent(\n\t\t\t\t\t\tisRenderingSVG\n\t\t\t\t\t\t\t? DOMUtils.appendOrSelect(selection, 'svg.layout-svg-wrapper')\n\t\t\t\t\t\t\t\t\t.attr('width', '100%')\n\t\t\t\t\t\t\t\t\t.attr('height', '100%')\n\t\t\t\t\t\t\t: selection\n\t\t\t\t\t)\n\n\t\t\t\t\t// Render preffered & fixed items\n\t\t\t\t\tconst growth = getProperty(d, 'growth')\n\t\t\t\t\tif (growth === LayoutGrowth.PREFERRED || growth === LayoutGrowth.FIXED) {\n\t\t\t\t\t\titemComponent.render(animate)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\n\t\tparent\n\t\t\t.selectAll(`div.layout-child-${this._instanceID}`)\n\t\t\t.style('height', null)\n\t\t\t.style('width', null)\n\t\t\t.each(function (d: any) {\n\t\t\t\t// Calculate preffered children sizes after internal rendering\n\t\t\t\tconst growth = getProperty(d, 'growth')\n\n\t\t\t\tconst renderType = getProperty(d, 'renderType')\n\t\t\t\tconst matchingElementDimensions =\n\t\t\t\t\trenderType === RenderTypes.SVG\n\t\t\t\t\t\t? DOMUtils.getSVGElementSize(select(this).select('svg.layout-svg-wrapper'), {\n\t\t\t\t\t\t\t\tuseBBox: true\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t: DOMUtils.getHTMLElementSize(this as any)\n\n\t\t\t\tif (growth === LayoutGrowth.PREFERRED) {\n\t\t\t\t\tconst matchingElementWidth = horizontal\n\t\t\t\t\t\t? matchingElementDimensions.width\n\t\t\t\t\t\t: matchingElementDimensions.height\n\t\t\t\t\tconst elementWidth = horizontal ? width : height\n\n\t\t\t\t\td.size = (matchingElementWidth / elementWidth) * 100\n\t\t\t\t}\n\t\t\t})\n\n\t\tupdatedBoxes.exit().remove()\n\n\t\t// Run through stretch x-items\n\t\tthis.children\n\t\t\t.filter(child => {\n\t\t\t\tconst growth = getProperty(child, 'growth')\n\t\t\t\treturn growth === LayoutGrowth.STRETCH\n\t\t\t})\n\t\t\t.forEach((child: any) => {\n\t\t\t\tchild.size = (100 - +this.getPreferedAndFixedSizeSum()) / +this.getNumOfStretchChildren()\n\t\t\t})\n\n\t\t// Update all boxes with new sizing\n\t\tconst allUpdatedBoxes = parent\n\t\t\t.selectAll(`div.layout-child-${this._instanceID}`)\n\t\t\t.data(this.children, (d: any) => d.id)\n\n\t\tif (horizontal) {\n\t\t\tallUpdatedBoxes\n\t\t\t\t.style('width', (d: any) => `${(d.size / 100) * width}px`)\n\t\t\t\t.style('height', '100%')\n\t\t} else {\n\t\t\tallUpdatedBoxes\n\t\t\t\t.style('height', (d: any) => `${(d.size / 100) * height}px`)\n\t\t\t\t.style('width', '100%')\n\t\t}\n\n\t\tallUpdatedBoxes.each(function (d: any) {\n\t\t\td.components.forEach((itemComponent: any) => {\n\t\t\t\tconst growth = getProperty(d, 'growth')\n\t\t\t\tif (growth === LayoutGrowth.STRETCH) {\n\t\t\t\t\titemComponent.render(animate)\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\t}\n\n\t// Pass on model to children as well\n\tsetModel(newObj: ChartModel) {\n\t\tsuper.setModel(newObj)\n\n\t\tthis.children.forEach((child: any) => {\n\t\t\tchild.components.forEach((component: Component) => component.setModel(newObj))\n\t\t})\n\t}\n\n\t// Pass on essentials to children as well\n\tsetServices(newObj: any) {\n\t\tsuper.setServices(newObj)\n\n\t\tthis.children.forEach((child: any) => {\n\t\t\tchild.components.forEach((component: Component) => component.setServices(newObj))\n\t\t})\n\t}\n\n\tdestroy() {\n\t\tthis.children.forEach((child: any) => {\n\t\t\tchild.components.forEach((component: Component) => component.destroy())\n\t\t})\n\t}\n}\n","import { spacers as spacerConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\n\nexport class Spacer extends Component {\n\ttype = 'spacer'\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = false) {\n\t\tthis.getComponentContainer()\n\t\t\t.style('width', `${this.configs.size || spacerConfigs.default.size}px`)\n\t\t\t.style('height', `${this.configs.size || spacerConfigs.default.size}px`)\n\t\t\t.attr('opacity', 0)\n\t}\n}\n","/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Settings.\n * @exports CarbonComponents.settings\n * @type Object\n * @property {boolean} [disableAutoInit]\n * Disables automatic instantiation of components.\n * By default (`CarbonComponents.disableAutoInit` is `false`),\n * carbon-components attempts to instantiate components automatically\n * by searching for elements with `data-component-name` (e.g. `data-loading`) attribute\n * or upon DOM events (e.g. clicking) on such elements.\n * See each components' static `.init()` methods for details.\n * @property {string} [prefix=bx]\n * Brand prefix. Should be in sync with `$prefix` Sass variable in carbon-components/src/globals/scss/_vars.scss.\n * // @todo given that the default value is so long, is it appropriate to put in the JSDoc?\n * @property {string} [selectorTabbable]\n * A selector selecting tabbable/focusable nodes.\n * By default selectorTabbable references links, areas, inputs, buttons, selects, textareas,\n * iframes, objects, embeds, or elements explicitly using tabindex or contenteditable attributes\n * as long as the element is not `disabled` or the `tabindex=\"-1\"`.\n * @property {string} [selectorFocusable]\n * CSS selector that selects major nodes that are click focusable\n * This property is identical to selectorTabbable with the exception of\n * the `:not([tabindex='-1'])` pseudo class\n */\nvar settings = {\n prefix: 'bx',\n selectorTabbable: \"\\n a[href], area[href], input:not([disabled]):not([tabindex='-1']),\\n button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']),\\n textarea:not([disabled]):not([tabindex='-1']),\\n iframe, object, embed, *[tabindex]:not([tabindex='-1']), *[contenteditable=true]\\n \",\n selectorFocusable: \"\\n a[href], area[href], input:not([disabled]),\\n button:not([disabled]),select:not([disabled]),\\n textarea:not([disabled]),\\n iframe, object, embed, *[tabindex], *[contenteditable=true]\\n \"\n};\nvar settings_1 = settings;\nexport { settings_1 as default };","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * @param {Array} a An array.\n * @returns {Array} The flattened version of the given array.\n */\n\n\nfunction flatten(a) {\n return a.reduce(function (result, item) {\n if (Array.isArray(item)) {\n result.push.apply(result, _toConsumableArray(flatten(item)));\n } else {\n result.push(item);\n }\n\n return result;\n }, []);\n}\n/**\n * An interface for defining mix-in classes. Used with {@link mixin}.\n * @function mixinfn\n * @param {Class} ToMix The class to mix.\n * @returns {Class} The class mixed-in with the given ToMix class.\n */\n\n/**\n * @function mixin\n * @param {...mixinfn} mixinfns The functions generating mix-ins.\n * @returns {Class} The class generated with the given mix-ins.\n */\n\n\nexport default function mixin() {\n for (var _len = arguments.length, mixinfns = new Array(_len), _key = 0; _key < _len; _key++) {\n mixinfns[_key] = arguments[_key];\n }\n\n return flatten(mixinfns).reduce(function (Class, mixinfn) {\n return mixinfn(Class);\n }, /*#__PURE__*/function () {\n function _class() {\n _classCallCheck(this, _class);\n }\n\n return _createClass(_class);\n }());\n}","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\nexport default function (ToMix) {\n var CreateComponent = /*#__PURE__*/function (_ToMix) {\n _inherits(CreateComponent, _ToMix);\n\n var _super = _createSuper(CreateComponent);\n /**\n * The component instances managed by this component.\n * Releasing this component also releases the components in `this.children`.\n * @type {Component[]}\n */\n\n /**\n * Mix-in class to manage lifecycle of component.\n * The constructor sets up this component's effective options,\n * and registers this component's instance associated to an element.\n * @implements Handle\n * @param {HTMLElement} element The element working as this component.\n * @param {object} [options] The component options.\n */\n\n\n function CreateComponent(element) {\n var _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, CreateComponent);\n\n _this = _super.call(this, element, options);\n _this.children = [];\n\n if (!element || element.nodeType !== Node.ELEMENT_NODE) {\n throw new TypeError('DOM element should be given to initialize this widget.');\n }\n /**\n * The element the component is of.\n * @type {Element}\n */\n\n\n _this.element = element;\n /**\n * The component options.\n * @type {object}\n */\n\n _this.options = Object.assign(Object.create(_this.constructor.options), options);\n\n _this.constructor.components.set(_this.element, _assertThisInitialized(_this));\n\n return _this;\n }\n /**\n * Instantiates this component of the given element.\n * @param {HTMLElement} element The element.\n */\n\n\n _createClass(CreateComponent, [{\n key: \"release\",\n value:\n /**\n * Releases this component's instance from the associated element.\n */\n function release() {\n for (var child = this.children.pop(); child; child = this.children.pop()) {\n child.release();\n }\n\n this.constructor.components.delete(this.element);\n return null;\n }\n }], [{\n key: \"create\",\n value: function create(element, options) {\n return this.components.get(element) || new this(element, options);\n }\n }]);\n\n return CreateComponent;\n }(ToMix);\n\n return CreateComponent;\n}","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _get() {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n _get = Reflect.get;\n } else {\n _get = function _get(target, property, receiver) {\n var base = _superPropBase(target, property);\n\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(arguments.length < 3 ? target : receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get.apply(this, arguments);\n}\n\nfunction _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = _getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\nexport default function (ToMix) {\n /**\n * Mix-in class to manage handles in component.\n * Managed handles are automatically released when the component with this class mixed in is released.\n * @class Handles\n * @implements Handle\n */\n var Handles = /*#__PURE__*/function (_ToMix) {\n _inherits(Handles, _ToMix);\n\n var _super = _createSuper(Handles);\n\n function Handles() {\n var _this;\n\n _classCallCheck(this, Handles);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n _this.handles = new Set();\n return _this;\n }\n\n _createClass(Handles, [{\n key: \"manage\",\n value:\n /**\n * Manages the given handle.\n * @param {Handle} handle The handle to manage.\n * @returns {Handle} The given handle.\n */\n function manage(handle) {\n this.handles.add(handle);\n return handle;\n }\n /**\n * Stop managing the given handle.\n * @param {Handle} handle The handle to stop managing.\n * @returns {Handle} The given handle.\n */\n\n }, {\n key: \"unmanage\",\n value: function unmanage(handle) {\n this.handles.delete(handle);\n return handle;\n }\n }, {\n key: \"release\",\n value: function release() {\n var _this2 = this;\n\n this.handles.forEach(function (handle) {\n handle.release();\n\n _this2.handles.delete(handle);\n });\n return _get(_getPrototypeOf(Handles.prototype), \"release\", this).call(this);\n }\n }]);\n\n return Handles;\n }(ToMix);\n\n return Handles;\n}","/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nexport default function on(element) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n element.addEventListener.apply(element, args);\n return {\n release: function release() {\n element.removeEventListener.apply(element, args);\n return null;\n }\n };\n}","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\nexport default function (ToMix) {\n /**\n * Mix-in class to manage events associated with states.\n * @class EventedState\n */\n var EventedState = /*#__PURE__*/function (_ToMix) {\n _inherits(EventedState, _ToMix);\n\n var _super = _createSuper(EventedState);\n\n function EventedState() {\n _classCallCheck(this, EventedState);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(EventedState, [{\n key: \"_changeState\",\n value:\n /* eslint-disable jsdoc/check-param-names */\n\n /**\n * The internal implementation for {@link EventedState#changeState `.changeState()`}, performing actual change in state.\n * @param {string} [state] The new state. Can be an omitted, which means toggling.\n * @param {object} [detail]\n * The object that should be put to event details that is fired before/after changing state.\n * Can have a `group` property, which specifies what state to be changed.\n * @param {EventedState~changeStateCallback} callback The callback called once changing state is finished or is canceled.\n * @private\n */\n function _changeState() {\n throw new Error('_changeState() should be overridden to perform actual change in state.');\n }\n /**\n * Changes the state of this component.\n * @param {string} [state] The new state. Can be an omitted, which means toggling.\n * @param {object} [detail]\n * The object that should be put to event details that is fired before/after changing state.\n * Can have a `group` property, which specifies what state to be changed.\n * @param {EventedState~changeStateCallback} [callback] The callback called once changing state is finished or is canceled.\n */\n\n }, {\n key: \"changeState\",\n value: function changeState() {\n var _this = this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var state = typeof args[0] === 'string' ? args.shift() : undefined;\n var detail = Object(args[0]) === args[0] && typeof args[0] !== 'function' ? args.shift() : undefined;\n var callback = typeof args[0] === 'function' ? args.shift() : undefined;\n\n if (typeof this.shouldStateBeChanged === 'function' && !this.shouldStateBeChanged(state, detail)) {\n if (callback) {\n callback(null, true);\n }\n\n return;\n }\n\n var data = {\n group: detail && detail.group,\n state: state\n };\n var eventNameSuffix = [data.group, state].filter(Boolean).join('-').split('-') // Group or state may contain hyphen\n .map(function (item) {\n return item[0].toUpperCase() + item.substr(1);\n }).join('');\n var eventStart = new CustomEvent(this.options[\"eventBefore\".concat(eventNameSuffix)], {\n bubbles: true,\n cancelable: true,\n detail: detail\n });\n var fireOnNode = detail && detail.delegatorNode || this.element;\n var canceled = !fireOnNode.dispatchEvent(eventStart);\n\n if (canceled) {\n if (callback) {\n var error = new Error(\"Changing state (\".concat(JSON.stringify(data), \") has been canceled.\"));\n error.canceled = true;\n callback(error);\n }\n } else {\n var changeStateArgs = [state, detail].filter(Boolean);\n\n this._changeState.apply(this, _toConsumableArray(changeStateArgs).concat([function () {\n fireOnNode.dispatchEvent(new CustomEvent(_this.options[\"eventAfter\".concat(eventNameSuffix)], {\n bubbles: true,\n cancelable: true,\n detail: detail\n }));\n\n if (callback) {\n callback();\n }\n }]));\n }\n }\n /* eslint-enable jsdoc/check-param-names */\n\n /**\n * Tests if change in state should happen or not.\n * Classes inheriting {@link EventedState `EventedState`} should override this function.\n * @function EventedState#shouldStateBeChanged\n * @param {string} [state] The new state. Can be an omitted, which means toggling.\n * @param {object} [detail]\n * The object that should be put to event details that is fired before/after changing state.\n * Can have a `group` property, which specifies what state to be changed.\n * @returns {boolean}\n * `false` if change in state shouldn't happen, e.g. when the given new state is the same as the current one.\n */\n\n }]);\n\n return EventedState;\n }(ToMix);\n /**\n * The callback called once changing state is finished or is canceled.\n * @callback EventedState~changeStateCallback\n * @param {Error} error\n * An error object with `true` in its `canceled` property if changing state is canceled.\n * Cancellation happens if the handler of a custom event, that is fired before changing state happens,\n * calls `.preventDefault()` against the event.\n * @param {boolean} keptState\n * `true` if the call to {@link EventedState#changeState `.changeState()`} didn't cause actual change in state.\n */\n\n\n return EventedState;\n}","/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * @param {Event} event The event.\n * @param {string} selector The selector.\n * @returns {Element}\n * The closest ancestor of the event target (or the event target itself) which matches the selectors given in parameter.\n */\nexport default function eventMatches(event, selector) {\n // <svg> in IE does not have `Element#msMatchesSelector()` (that should be copied to `Element#matches()` by a polyfill).\n // Also a weird behavior is seen in IE where DOM tree seems broken when `event.target` is on <svg>.\n // Therefore this function simply returns `undefined` when `event.target` is on <svg>.\n var target = event.target,\n currentTarget = event.currentTarget;\n\n if (typeof target.matches === 'function') {\n if (target.matches(selector)) {\n // If event target itself matches the given selector, return it\n return target;\n }\n\n if (target.matches(\"\".concat(selector, \" *\"))) {\n var closest = target.closest(selector);\n\n if ((currentTarget.nodeType === Node.DOCUMENT_NODE ? currentTarget.documentElement : currentTarget).contains(closest)) {\n return closest;\n }\n }\n }\n\n return undefined;\n}","/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nexport default function getLaunchingDetails(evt) {\n if (!evt || typeof evt === 'function') {\n return {\n launchingElement: null,\n launchingEvent: null\n };\n }\n\n var launchingElement = evt.delegateTarget || evt.currentTarget || evt;\n var launchingEvent = evt.currentTarget && evt;\n\n if (launchingElement && !launchingElement.nodeType) {\n throw new TypeError('DOM Node should be given for launching element.');\n }\n\n if (launchingEvent && !launchingEvent.type) {\n throw new TypeError('DOM event should be given for launching event.');\n }\n\n return {\n launchingElement: launchingElement,\n launchingEvent: launchingEvent\n };\n}","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\nimport eventedState from './evented-state';\nimport getLaunchingDetails from '../misc/get-launching-details';\n\nfunction eventedShowHideState(ToMix) {\n /**\n * Mix-in class to launch a floating menu.\n * @class EventedShowHideState\n */\n var EventedShowHideState = /*#__PURE__*/function (_ToMix) {\n _inherits(EventedShowHideState, _ToMix);\n\n var _super = _createSuper(EventedShowHideState);\n\n function EventedShowHideState() {\n _classCallCheck(this, EventedShowHideState);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(EventedShowHideState, [{\n key: \"show\",\n value:\n /**\n */\n\n /**\n * Switch to 'shown' state.\n * @param [evtOrElem] The launching event or element.\n * @param {EventedState~changeStateCallback} [callback] The callback.\n */\n function show(evtOrElem, callback) {\n if (!evtOrElem || typeof evtOrElem === 'function') {\n callback = evtOrElem; // eslint-disable-line no-param-reassign\n }\n\n this.changeState('shown', getLaunchingDetails(evtOrElem), callback);\n }\n /**\n * Switch to 'hidden' state.\n * @param [evtOrElem] The launching event or element.\n * @param {EventedState~changeStateCallback} [callback] The callback.\n */\n\n }, {\n key: \"hide\",\n value: function hide(evtOrElem, callback) {\n if (!evtOrElem || typeof evtOrElem === 'function') {\n callback = evtOrElem; // eslint-disable-line no-param-reassign\n }\n\n this.changeState('hidden', getLaunchingDetails(evtOrElem), callback);\n }\n }]);\n\n return EventedShowHideState;\n }(ToMix);\n\n return EventedShowHideState;\n}\n\nvar exports = [eventedState, eventedShowHideState];\nexport default exports;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\nimport eventMatches from '../misc/event-matches';\nimport on from '../misc/on';\nexport default function (ToMix) {\n /**\n * Mix-in class to instantiate components events on launcher button.\n * @class InitComponentByLauncher\n */\n var InitComponentByLauncher = /*#__PURE__*/function (_ToMix) {\n _inherits(InitComponentByLauncher, _ToMix);\n\n var _super = _createSuper(InitComponentByLauncher);\n\n function InitComponentByLauncher() {\n _classCallCheck(this, InitComponentByLauncher);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(InitComponentByLauncher, null, [{\n key: \"init\",\n value:\n /**\n * `true` suggests that this component is lazily initialized upon an action/event, etc.\n * @type {boolean}\n */\n\n /**\n * Instantiates this component in the given element.\n * If the given element indicates that it's an component of this class, instantiates it.\n * Otherwise, instantiates this component by clicking on launcher buttons\n * (buttons with attribute that `options.attribInitTarget` points to) of this component in the given node.\n * @param {Node} target The DOM node to instantiate this component in. Should be a document or an element.\n * @param {object} [options] The component options.\n * @param {string} [options.selectorInit] The CSS selector to find this component.\n * @param {string} [options.attribInitTarget] The attribute name in the launcher buttons to find target component.\n * @returns {Handle} The handle to remove the event listener to handle clicking.\n */\n function init() {\n var _this = this;\n\n var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var effectiveOptions = Object.assign(Object.create(this.options), options);\n\n if (!target || target.nodeType !== Node.ELEMENT_NODE && target.nodeType !== Node.DOCUMENT_NODE) {\n throw new TypeError('DOM document or DOM element should be given to search for and initialize this widget.');\n }\n\n if (target.nodeType === Node.ELEMENT_NODE && target.matches(effectiveOptions.selectorInit)) {\n this.create(target, options);\n } else {\n var handles = effectiveOptions.initEventNames.map(function (name) {\n return on(target, name, function (event) {\n var launcher = eventMatches(event, \"[\".concat(effectiveOptions.attribInitTarget, \"]\"));\n\n if (launcher) {\n event.delegateTarget = launcher; // eslint-disable-line no-param-reassign\n\n // eslint-disable-line no-param-reassign\n var elements = launcher.ownerDocument.querySelectorAll(launcher.getAttribute(effectiveOptions.attribInitTarget));\n\n if (elements.length > 1) {\n throw new Error('Target widget must be unique.');\n }\n\n if (elements.length === 1) {\n if (launcher.tagName === 'A') {\n event.preventDefault();\n }\n\n var component = _this.create(elements[0], options);\n\n if (typeof component.createdByLauncher === 'function') {\n component.createdByLauncher(event);\n }\n }\n }\n });\n });\n return {\n release: function release() {\n for (var handle = handles.pop(); handle; handle = handles.pop()) {\n handle.release();\n }\n }\n };\n }\n\n return '';\n }\n }]);\n\n InitComponentByLauncher.forLazyInit = true;\n return InitComponentByLauncher;\n }(ToMix);\n\n return InitComponentByLauncher;\n}","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\nimport warning from 'warning';\nimport settings from '../../globals/js/settings';\nimport mixin from '../../globals/js/misc/mixin';\nimport createComponent from '../../globals/js/mixins/create-component';\nimport initComponentByLauncher from '../../globals/js/mixins/init-component-by-launcher';\nimport eventedShowHideState from '../../globals/js/mixins/evented-show-hide-state';\nimport handles from '../../globals/js/mixins/handles';\nimport eventMatches from '../../globals/js/misc/event-matches';\nimport on from '../../globals/js/misc/on';\n\nvar Modal = /*#__PURE__*/function (_mixin) {\n _inherits(Modal, _mixin);\n\n var _super = _createSuper(Modal);\n /**\n * Modal dialog.\n * @extends CreateComponent\n * @extends InitComponentByLauncher\n * @extends EventedShowHideState\n * @extends Handles\n * @param {HTMLElement} element The element working as a modal dialog.\n * @param {object} [options] The component options.\n * @param {string} [options.classVisible] The CSS class for the visible state.\n * @param {string} [options.classBody] The CSS class for `<body>` with open modal.\n * @param {string} [options.eventBeforeShown]\n * The name of the custom event fired before this modal is shown.\n * Cancellation of this event stops showing the modal.\n * @param {string} [options.eventAfterShown]\n * The name of the custom event telling that modal is sure shown\n * without being canceled by the event handler named by `eventBeforeShown` option (`modal-beingshown`).\n * @param {string} [options.eventBeforeHidden]\n * The name of the custom event fired before this modal is hidden.\n * Cancellation of this event stops hiding the modal.\n * @param {string} [options.eventAfterHidden]\n * The name of the custom event telling that modal is sure hidden\n * without being canceled by the event handler named by `eventBeforeHidden` option (`modal-beinghidden`).\n */\n\n\n /**\n * Modal dialog.\n * @extends CreateComponent\n * @extends InitComponentByLauncher\n * @extends EventedShowHideState\n * @extends Handles\n * @param {HTMLElement} element The element working as a modal dialog.\n * @param {object} [options] The component options.\n * @param {string} [options.classVisible] The CSS class for the visible state.\n * @param {string} [options.classBody] The CSS class for `<body>` with open modal.\n * @param {string} [options.eventBeforeShown]\n * The name of the custom event fired before this modal is shown.\n * Cancellation of this event stops showing the modal.\n * @param {string} [options.eventAfterShown]\n * The name of the custom event telling that modal is sure shown\n * without being canceled by the event handler named by `eventBeforeShown` option (`modal-beingshown`).\n * @param {string} [options.eventBeforeHidden]\n * The name of the custom event fired before this modal is hidden.\n * Cancellation of this event stops hiding the modal.\n * @param {string} [options.eventAfterHidden]\n * The name of the custom event telling that modal is sure hidden\n * without being canceled by the event handler named by `eventBeforeHidden` option (`modal-beinghidden`).\n */\n function Modal(element, options) {\n var _this;\n\n _classCallCheck(this, Modal);\n\n _this = _super.call(this, element, options);\n _this._handleFocusinListener = void 0;\n _this._handleKeydownListener = void 0;\n\n _this._handleFocusin = function (evt) {\n var focusWrapNode = _this.element.querySelector(_this.options.selectorModalContainer) || _this.element;\n\n if (_this.element.classList.contains(_this.options.classVisible) && !focusWrapNode.contains(evt.target) && _this.options.selectorsFloatingMenus.every(function (selector) {\n return !eventMatches(evt, selector);\n })) {\n _this.element.querySelector(settings.selectorTabbable).focus();\n }\n };\n\n _this._hookCloseActions();\n\n return _this;\n }\n /**\n * The handle for `focusin` event listener.\n * Used for \"focus-wrap\" feature.\n * @type {Handle}\n * @private\n */\n\n\n /**\n * The handle for `focusin` event listener.\n * Used for \"focus-wrap\" feature.\n * @type {Handle}\n * @private\n */\n _createClass(Modal, [{\n key: \"createdByLauncher\",\n value:\n /**\n * A method that runs when `.init()` is called from `initComponentByLauncher`.\n * @param {Event} evt The event fired on the launcher button.\n */\n function createdByLauncher(evt) {\n this.show(evt);\n }\n /**\n * Determines whether or not to emit events and callback function when `.changeState()` is called from `eventedState`.\n * @param {string} state The new state.\n * @returns {boolean} `true` if the given `state` is different from current state.\n */\n\n }, {\n key: \"shouldStateBeChanged\",\n value: function shouldStateBeChanged(state) {\n if (state === 'shown') {\n return !this.element.classList.contains(this.options.classVisible);\n }\n\n return this.element.classList.contains(this.options.classVisible);\n }\n /**\n * Changes the shown/hidden state.\n * @private\n * @param {string} state The new state.\n * @param {object} detail The detail data to be included in the event that will be fired.\n * @param {Function} callback Callback called when change in state completes.\n */\n\n }, {\n key: \"_changeState\",\n value: function _changeState(state, detail, callback) {\n var _this2 = this;\n\n var handleTransitionEnd;\n\n var transitionEnd = function transitionEnd() {\n if (handleTransitionEnd) {\n handleTransitionEnd = _this2.unmanage(handleTransitionEnd).release();\n }\n\n if (state === 'shown' && _this2.element.offsetWidth > 0 && _this2.element.offsetHeight > 0) {\n _this2.previouslyFocusedNode = _this2.element.ownerDocument.activeElement;\n\n var focusableItem = _this2.element.querySelector(_this2.options.selectorPrimaryFocus) || _this2.element.querySelector(settings.selectorTabbable);\n\n focusableItem.focus();\n\n if (process.env.NODE_ENV !== \"production\") {\n process.env.NODE_ENV !== \"production\" ? warning(focusableItem, \"Modals need to contain a focusable element by either using \" + \"`\".concat(_this2.options.selectorPrimaryFocus, \"` or settings.selectorTabbable.\")) : void 0;\n }\n }\n\n callback();\n };\n\n if (this._handleFocusinListener) {\n this._handleFocusinListener = this.unmanage(this._handleFocusinListener).release();\n }\n\n if (state === 'shown') {\n var hasFocusin = ('onfocusin' in this.element.ownerDocument.defaultView);\n var focusinEventName = hasFocusin ? 'focusin' : 'focus';\n this._handleFocusinListener = this.manage(on(this.element.ownerDocument, focusinEventName, this._handleFocusin, !hasFocusin));\n }\n\n if (state === 'hidden') {\n this.element.classList.toggle(this.options.classVisible, false);\n this.element.ownerDocument.body.classList.toggle(this.options.classBody, false);\n\n if (this.options.selectorFocusOnClose || this.previouslyFocusedNode) {\n (this.element.ownerDocument.querySelector(this.options.selectorFocusOnClose) || this.previouslyFocusedNode).focus();\n }\n } else if (state === 'shown') {\n this.element.classList.toggle(this.options.classVisible, true);\n this.element.ownerDocument.body.classList.toggle(this.options.classBody, true);\n }\n\n handleTransitionEnd = this.manage(on(this.element, 'transitionend', transitionEnd));\n }\n }, {\n key: \"_hookCloseActions\",\n value: function _hookCloseActions() {\n var _this3 = this;\n\n this.manage(on(this.element, 'click', function (evt) {\n var closeButton = eventMatches(evt, _this3.options.selectorModalClose);\n\n if (closeButton) {\n evt.delegateTarget = closeButton; // eslint-disable-line no-param-reassign\n }\n\n if (closeButton || evt.target === _this3.element) {\n _this3.hide(evt);\n }\n }));\n\n if (this._handleKeydownListener) {\n this._handleKeydownListener = this.unmanage(this._handleKeydownListener).release();\n }\n\n this._handleKeydownListener = this.manage(on(this.element.ownerDocument.body, 'keydown', function (evt) {\n // Avoid running `evt.stopPropagation()` only when modal is shown\n if (evt.which === 27 && _this3.shouldStateBeChanged('hidden')) {\n evt.stopPropagation();\n\n _this3.hide(evt);\n }\n }));\n }\n /**\n * Handles `focusin` (or `focus` depending on browser support of `focusin`) event to do wrap-focus behavior.\n * @param {Event} evt The event.\n * @private\n */\n\n }], [{\n key: \"options\",\n get:\n /**\n * The component options.\n * If `options` is specified in the constructor, {@linkcode Modal.create .create()}, or {@linkcode Modal.init .init()},\n * properties in this object are overridden for the instance being create and how {@linkcode Modal.init .init()} works.\n * @member Modal.options\n * @type {object}\n * @property {string} selectorInit The CSS class to find modal dialogs.\n * @property {string} [selectorModalClose] The selector to find elements that close the modal.\n * @property {string} [selectorPrimaryFocus] The CSS selector to determine the element to put focus when modal gets open.\n * @property {string} [selectorFocusOnClose] The CSS selector to determine the element to put focus when modal closes.\n * If undefined, focus returns to the previously focused element prior to the modal opening.\n * @property {string} [selectorModalContainer] The CSS selector for the content container of the modal for focus wrap feature.\n * @property {string} attribInitTarget The attribute name in the launcher buttons to find target modal dialogs.\n * @property {string[]} [selectorsFloatingMenu]\n * The CSS selectors of floating menus.\n * Used for detecting if focus-wrap behavior should be disabled temporarily.\n * @property {string} [classVisible] The CSS class for the visible state.\n * @property {string} [classBody] The CSS class for `<body>` with open modal.\n * @property {string} [classNoScroll] The CSS class for hiding scroll bar in body element while modal is shown.\n * @property {string} [eventBeforeShown]\n * The name of the custom event fired before this modal is shown.\n * Cancellation of this event stops showing the modal.\n * @property {string} [eventAfterShown]\n * The name of the custom event telling that modal is sure shown\n * without being canceled by the event handler named by `eventBeforeShown` option (`modal-beingshown`).\n * @property {string} [eventBeforeHidden]\n * The name of the custom event fired before this modal is hidden.\n * Cancellation of this event stops hiding the modal.\n * @property {string} [eventAfterHidden]\n * The name of the custom event telling that modal is sure hidden\n * without being canceled by the event handler named by `eventBeforeHidden` option (`modal-beinghidden`).\n */\n function get() {\n var prefix = settings.prefix;\n return {\n selectorInit: '[data-modal]',\n selectorModalClose: '[data-modal-close]',\n selectorPrimaryFocus: '[data-modal-primary-focus]',\n selectorsFloatingMenus: [\".\".concat(prefix, \"--overflow-menu-options\"), \".\".concat(prefix, \"--tooltip\"), '.flatpickr-calendar'],\n selectorModalContainer: \".\".concat(prefix, \"--modal-container\"),\n classVisible: 'is-visible',\n classBody: \"\".concat(prefix, \"--body--with-modal-open\"),\n attribInitTarget: 'data-modal-target',\n initEventNames: ['click'],\n eventBeforeShown: 'modal-beingshown',\n eventAfterShown: 'modal-shown',\n eventBeforeHidden: 'modal-beinghidden',\n eventAfterHidden: 'modal-hidden'\n };\n }\n }]);\n\n Modal.components = new WeakMap();\n return Modal;\n}(mixin(createComponent, initComponentByLauncher, eventedShowHideState, handles));\n\nexport default Modal;","import { select, type Selection } from 'd3'\nimport { get } from 'lodash-es'\nimport { Modal as CarbonModalComponent } from 'carbon-components' // /es/components/modal\nimport { getProperty } from '@/tools'\nimport { carbonPrefix } from '@/configuration-non-customizable' // CSS prefix\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport type { ChartModel } from '@/model/model'\nimport type { ChartOptions } from '@/interfaces/charts'\nimport { Events } from '@/interfaces/enums'\nimport { sanitizeText } from '@/utils/sanitizeHtml'\n\nexport class Modal extends Component {\n\ttype = 'modal'\n\n\t// flag for checking whether tooltip event listener is added or not\n\tisEventListenerAdded = false\n\tmodal: any\n\n\tconstructor(model: ChartModel, services: any, configs?: any) {\n\t\tsuper(model, services, configs)\n\n\t\tthis.init()\n\t}\n\n\thandleShowModal = () => {\n\t\tconst id = this.services.domUtils.getChartID()\n\t\tthis.modal\n\t\t\t.attr('data-modal', true)\n\t\t\t.attr('class', 'cds--modal')\n\t\t\t.attr('role', 'dialog')\n\t\t\t.attr('aria-modal', true)\n\t\t\t.attr('aria-labelledby', `${id}__modal-title`)\n\t\t\t.attr('aria-describedby', `${id}__modal-description`)\n\t\t\t.attr('tabindex', -1)\n\n\t\tthis.modal.html(this.getModalHTML())\n\t\tthis.modal\n\t\t\t.select('div.cds--modal-footer button.cds--btn')\n\t\t\t.on('click', () => this.model.exportToCSV())\n\n\t\tconst modalInstance = CarbonModalComponent.create(this.modal.node())\n\t\tmodalInstance.show()\n\n\t\t//catches when modal gets closed\n\t\tdocument.addEventListener('modal-hidden', this.handleHideModal)\n\t}\n\n\thandleHideModal = () => {\n\t\tthis.modal\n\t\t\t.attr('role', null)\n\t\t\t.attr('aria-modal', null)\n\t\t\t.attr('aria-labelledby', null)\n\t\t\t.attr('aria-describedby', null)\n\t\t\t.attr('tabindex', null)\n\n\t\t//removes event listener when modal is closed\n\t\tdocument.removeEventListener('modal-hidden', this.handleHideModal)\n\t}\n\n\taddEventListeners() {\n\t\t// listen to show-modal Custom Events to render the modal\n\t\tthis.services.events.addEventListener(Events.Modal.SHOW, this.handleShowModal)\n\t}\n\n\tremoveEventListeners() {\n\t\t// remove show-modal Custom Events\n\t\tthis.services.events.removeEventListener(Events.Modal.SHOW, this.handleShowModal)\n\t}\n\n\tgetModalHTML() {\n\t\tconst id = this.services.domUtils.getChartID()\n\n\t\tconst options = this.model.getOptions()\n\n\t\tconst chartprefix = getProperty(options, 'style', 'prefix')\n\n\t\tconst tableArray = this.model.getTabularDataArray()\n\n\t\treturn `\n\t\t<div class=\"cds--modal-container cds--modal-container\">\n\t\t\t<div class=\"cds--modal-header cds--modal-header\">\n\t\t\t\t<p class=\"cds--modal-header__label cds--type-delta cds--modal-header__label cds--type-delta\" id=\"${id}__modal-title\">Tabular representation</p>\n\n\t\t\t\t<p class=\"cds--modal-header__heading cds--type-beta cds--modal-header__heading cds--type-beta\" id=\"${id}__modal-description\">${sanitizeText(\n\t\t\t\t\toptions.title\n\t\t\t\t)}</p>\n\n\t\t\t\t<button class=\"cds--modal-close cds--modal-close\" type=\"button\" data-modal-close aria-label=\"close modal\" data-modal-primary-focus>\n\t\t\t\t\t<svg focusable=\"false\" preserveAspectRatio=\"xMidYMid meet\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" aria-label=\"Close\" width=\"20\" height=\"20\" viewBox=\"0 0 32 32\" role=\"img\" class=\"cds--modal-close__icon cds--modal-close__icon\">\n\t\t\t\t\t\t<path d=\"M24 9.4L22.6 8 16 14.6 9.4 8 8 9.4 14.6 16 8 22.6 9.4 24 16 17.4 22.6 24 24 22.6 17.4 16 24 9.4z\"></path>\n\t\t\t\t\t</svg>\n\t\t\t\t</button>\n\t\t\t</div>\n\n\t\t\t<div class=\"cds--modal-content cds--modal-content\">\n\t\t\t\t<table class=\"cds--data-table cds--data-table--no-border cds--data-table cds--data-table--no-border\">\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t${get(tableArray, 0)\n\t\t\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t\t\t(heading: any) => `<th scope=\"col\">\n\t\t\t\t\t\t\t\t<div class=\"cds--table-header-label cds--table-header-label\">${sanitizeText(heading)}</div>\n\t\t\t\t\t\t\t</th>`\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t.join('')}\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\n\t\t\t\t\t<tbody>${tableArray\n\t\t\t\t\t\t.slice(1)\n\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t(row: any) => `\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t${row.map((column: any) => `<td>${sanitizeText(column)}</td>`).join('')}\n\t\t\t\t\t\t\t</tr>`\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join('')}\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\t\t</div>\n\n\t\t\t<div class=\"cds--modal-footer cds--modal-footer\">\n\t\t\t <div class=\"${carbonPrefix}--${chartprefix}-modal-footer-spacer\"></div>\n\t\t\t <button class=\"cds--btn cds--btn--primary cds--btn cds--btn--primary\" type=\"button\" data-modal-primary-focus>Download as CSV</button>\n\t\t\t</div>\n\t\t</div>`\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = false) {\n\t\tconst options = this.model.getOptions() as ChartOptions\n\t\tif (!this.isEventListenerAdded) {\n\t\t\t// Grab the tooltip element\n\t\t\tconst holder = select(this.services.domUtils.getHolder()) as Selection<\n\t\t\t\tHTMLDivElement,\n\t\t\t\tany,\n\t\t\t\tElement,\n\t\t\t\tany\n\t\t\t>\n\t\t\tconst chartprefix = getProperty(options, 'style', 'prefix') as string\n\t\t\tthis.modal = DOMUtils.appendOrSelect(holder, `div.${carbonPrefix}--${chartprefix}--modal`)\n\n\t\t\tthis.addEventListeners()\n\t\t\tthis.isEventListenerAdded = true\n\t\t}\n\t}\n\n\tdestroy() {\n\t\t// remove tooltip eventListener\n\t\tthis.removeEventListeners()\n\t\tthis.isEventListenerAdded = false\n\t}\n}\n","import type { Selection } from 'd3'\nimport { getProperty } from '@/tools'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { Events, RenderTypes } from '@/interfaces/enums'\nimport { sanitizeText } from '@/utils/sanitizeHtml'\n\nexport class Title extends Component {\n\ttype = 'title'\n\trenderType = RenderTypes.HTML\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = false) {\n\t\tconst svg = this.getComponentContainer()\n\t\tconst title = getProperty(this.getOptions(), 'title')\n\n\t\tconst text = svg.selectAll('p.title').data([title]) as Selection<\n\t\t\tHTMLParagraphElement,\n\t\t\tany,\n\t\t\tElement,\n\t\t\tany\n\t\t>\n\n\t\ttext\n\t\t\t.enter()\n\t\t\t.append('p')\n\t\t\t.classed('title', true)\n\t\t\t.attr('role', 'heading')\n\t\t\t.attr('aria-level', 2)\n\t\t\t.merge(text as any)\n\t\t\t.html((d: any) => sanitizeText(d))\n\n\t\t// check if title needs truncation (and tooltip support)\n\t\tif (text.node() && text.node().offsetWidth < text.node().scrollWidth) {\n\t\t\t// add events for displaying the tooltip with the title\n\t\t\tconst self = this\n\t\t\ttext\n\t\t\t\t.on('mouseover', function (event: MouseEvent) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\thoveredElement: text,\n\t\t\t\t\t\tcontent: text.text()\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t\t.on('mousemove', function (event: MouseEvent) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\t\tevent\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t\t.on('mouseout', function () {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE)\n\t\t\t\t})\n\t\t}\n\n\t\ttext.exit().remove()\n\t}\n\n\t/**\n\t * Truncates title creating ellipses and attaching tooltip for exposing full title.\n\t */\n\ttruncateTitle(title: any, maxWidth: number) {\n\t\t// sanity check to prevent stack overflow on binary search\n\t\tif (maxWidth <= 0) {\n\t\t\treturn\n\t\t}\n\n\t\tconst untruncatedTitle = title.text()\n\t\t// check if the title is too big for the containing svg\n\t\tif (title.node().getComputedTextLength() > maxWidth) {\n\t\t\t// append the ellipses to their own tspan to calculate the text length\n\t\t\ttitle.append('tspan').text('...')\n\n\t\t\t// get the bounding width including the elipses '...'\n\t\t\tconst tspanLength = DOMUtils.appendOrSelect(title, 'tspan').node().getComputedTextLength()\n\n\t\t\t// with elipses\n\t\t\tconst titleString = title.text()\n\n\t\t\t// get the index for creating the max length substring that fit within the svg\n\t\t\t// use one less than the index to avoid crowding (the elipsis)\n\t\t\tconst substringIndex = this.getSubstringIndex(\n\t\t\t\ttitle.node(),\n\t\t\t\t0,\n\t\t\t\ttitleString.length - 1,\n\t\t\t\tmaxWidth - tspanLength\n\t\t\t)\n\n\t\t\t// use the substring as the title\n\t\t\ttitle\n\t\t\t\t.html(titleString.substring(0, substringIndex - 1))\n\t\t\t\t.append('tspan')\n\t\t\t\t.text('...')\n\n\t\t\t// add events for displaying the tooltip with the title\n\t\t\tconst self = this\n\t\t\ttitle\n\t\t\t\t.on('mouseover', function (event: MouseEvent) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\thoveredElement: title,\n\t\t\t\t\t\tcontent: untruncatedTitle\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t\t.on('mousemove', function (event: MouseEvent) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\t\tevent\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t\t.on('mouseout', function () {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE)\n\t\t\t\t})\n\t\t}\n\t}\n\n\t// computes the maximum space a title can take\n\tprotected getMaxTitleWidth() {\n\t\treturn DOMUtils.getSVGElementSize(this.parent.node() as any, {\n\t\t\tuseAttrs: true\n\t\t}).width\n\t}\n\n\t/**\n\t * Returns the index for a maximum length substring that is less than the width parameter.\n\t * @param title the title node used for getting the text lengths of substrings\n\t * @param start the start index for the binary search\n\t * @param end the end index for the binary search\n\t * @param width the width of the svg container that holds the title\n\t */\n\tprotected getSubstringIndex(title: any, start: number, end: number, width: number): number {\n\t\tconst mid = Math.floor((end + start) / 2)\n\t\tif (title.getSubStringLength(0, mid) > width) {\n\t\t\treturn this.getSubstringIndex(title, start, mid, width)\n\t\t} else if (title.getSubStringLength(0, mid) < width) {\n\t\t\tif (title.getSubStringLength(0, mid + 1) > width) {\n\t\t\t\treturn mid\n\t\t\t}\n\t\t\treturn this.getSubstringIndex(title, mid, end, width)\n\t\t} else {\n\t\t\treturn mid\n\t\t}\n\t}\n}\n","export enum Roles {\n\tGRAPHICS_DOCUMENT = 'graphics-document',\n\tGRAPHICS_OBJECT = 'graphics-object',\n\tGRAPHICS_SYMBOL = 'graphics-symbol',\n\tGROUP = 'group',\n\tDOCUMENT = 'document',\n\tCHECKBOX = 'checkbox',\n\tBUTTON = 'button',\n\tMENU = 'menu',\n\tMENU_ITEM = 'menuitem',\n\tIMG = 'img'\n}\n","import { select } from 'd3'\nimport { getProperty, truncateLabel } from '@/tools'\nimport { legend as legendConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport {\n\tAlignments,\n\tColorClassNameTypes,\n\tLegendItemType,\n\tRenderTypes,\n\tEvents,\n\tTruncationTypes\n} from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\nimport { sanitizeText } from '@/utils/sanitizeHtml'\n\nexport class Legend extends Component {\n\ttype = 'legend'\n\trenderType = RenderTypes.HTML\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = false) {\n\t\tconst options = this.getOptions()\n\t\tconst legendOptions = getProperty(options, 'legend')\n\t\tconst alignment = getProperty(legendOptions, 'alignment')\n\n\t\tconst legendOrientation = getProperty(options, 'legend', 'orientation')\n\n\t\tlet dataGroups = this.model.getDataGroups()\n\n\t\t// Check if there are disabled legend items\n\t\tconst { DISABLED } = legendConfigs.items.status\n\t\tconst hasDeactivatedItems = dataGroups.some((dataGroup: any) => dataGroup.status === DISABLED)\n\t\tconst userProvidedOrder = getProperty(legendOptions, 'order')\n\n\t\tconst svg = this.getComponentContainer()\n\t\t\t.classed('center-aligned', alignment === Alignments.CENTER)\n\t\t\t.classed('right-aligned', alignment === Alignments.RIGHT)\n\t\t\t.classed(legendOrientation, true)\n\t\t\t.classed('has-deactivated-items', hasDeactivatedItems)\n\t\t\t.attr('role', Roles.GROUP)\n\t\t\t.attr('aria-label', 'Data groups')\n\t\t\t.attr('data-name', 'legend-items')\n\n\t\tif (userProvidedOrder) {\n\t\t\tdataGroups = this.sortDataGroups(dataGroups, userProvidedOrder)\n\t\t}\n\n\t\tconst legendItems = svg\n\t\t\t.selectAll('div.legend-item')\n\t\t\t.data(dataGroups, (dataGroup: any) => dataGroup.name)\n\n\t\tconst addedLegendItems = legendItems.enter().append('div').attr('class', 'legend-item')\n\n\t\taddedLegendItems.merge(svg.selectAll('div.legend-item')).classed('active', function (d: any) {\n\t\t\treturn d.status === legendConfigs.items.status.ACTIVE\n\t\t})\n\n\t\tconst legendClickable = getProperty(this.getOptions(), 'legend', 'clickable')\n\t\tsvg.classed('clickable', legendClickable && dataGroups.length > 1)\n\n\t\tconst checkboxRadius = legendConfigs.checkbox.radius\n\n\t\tconst addedCheckboxes = addedLegendItems.append('div').classed('checkbox', true)\n\n\t\tconst allCheckboxes = addedCheckboxes\n\t\t\t.merge(legendItems.select('div.checkbox'))\n\t\t\t.attr('role', Roles.CHECKBOX)\n\t\t\t.attr('tabindex', legendClickable ? 0 : -1)\n\t\t\t.attr('aria-labelledby', (_: any, i: number) =>\n\t\t\t\tthis.services.domUtils.generateElementIDString(`legend-datagroup-${i}-title`)\n\t\t\t)\n\t\t\t.attr('aria-checked', ({ status }) => status === legendConfigs.items.status.ACTIVE)\n\t\t\t.attr('width', checkboxRadius * 2)\n\t\t\t.attr('height', checkboxRadius * 2)\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.BACKGROUND],\n\t\t\t\t\tdataGroupName: d.name,\n\t\t\t\t\toriginalClassName: 'checkbox'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('background', (d: any) =>\n\t\t\t\td.status === legendConfigs.items.status.ACTIVE\n\t\t\t\t\t? this.model.getFillColor(d.name) || this.model.getStrokeColor(d.name)\n\t\t\t\t\t: null\n\t\t\t)\n\t\t\t.classed('active', function (d: any) {\n\t\t\t\treturn d.status === legendConfigs.items.status.ACTIVE\n\t\t\t})\n\n\t\taddedCheckboxes\n\t\t\t.append('svg')\n\t\t\t.attr('focusable', false)\n\t\t\t.attr('preserveAspectRatio', 'xMidYMid meet')\n\t\t\t.attr('xmlns', 'http://www.w3.org/2000/svg')\n\t\t\t.attr('width', '11')\n\t\t\t.attr('height', '11')\n\t\t\t.attr('viewBox', '0 0 31 28')\n\t\t\t.attr('aria-hidden', true)\n\t\t\t.style('will-change', 'transform')\n\t\t\t.append('path')\n\t\t\t.attr('d', 'M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z')\n\n\t\taddedLegendItems.append('p').merge(legendItems.select('p'))\n\n\t\tconst additionalItemsOption = getProperty(options, 'legend', 'additionalItems')\n\n\t\t// add additional legend items\n\t\tif (additionalItemsOption && dataGroups.length) {\n\t\t\tconst self = this\n\n\t\t\tconst additionalItems = svg.selectAll('div.additional-item').data(additionalItemsOption)\n\n\t\t\tadditionalItems.exit().remove()\n\n\t\t\tconst addedAdditionalItems = additionalItems\n\t\t\t\t.enter()\n\t\t\t\t.append('div')\n\t\t\t\t.merge(additionalItems as any)\n\t\t\t\t.classed('legend-item', true)\n\t\t\t\t.classed('additional', true)\n\t\t\t\t.attr('aria-labelledby', (_: any, i: number) =>\n\t\t\t\t\tthis.services.domUtils.generateElementIDString(\n\t\t\t\t\t\t`legend-datagroup-${allCheckboxes.size() + i}-title`\n\t\t\t\t\t)\n\t\t\t\t)\n\n\t\t\t// remove nested child elements that no longer needed\n\t\t\taddedAdditionalItems.selectAll('*').remove()\n\n\t\t\t// get index of item with same type to assign distinct classname\n\t\t\tlet previousType: any\n\t\t\tlet indexOfItem = 1\n\n\t\t\t// add different type of legend items\n\t\t\taddedAdditionalItems\n\t\t\t\t.append('svg')\n\t\t\t\t.classed('icon', true)\n\t\t\t\t.each(function (d: any) {\n\t\t\t\t\tconst additionalItem = select(this)\n\n\t\t\t\t\tif (!previousType || previousType != d.type) {\n\t\t\t\t\t\tpreviousType = d.type\n\t\t\t\t\t\tindexOfItem = 1\n\t\t\t\t\t} else {\n\t\t\t\t\t\tindexOfItem++\n\t\t\t\t\t}\n\n\t\t\t\t\tself.addAdditionalItem(additionalItem, d, indexOfItem)\n\t\t\t\t})\n\n\t\t\taddedAdditionalItems.append('p').merge(addedAdditionalItems.select('p'))\n\n\t\t\tthis.truncateLegendText()\n\t\t}\n\n\t\t// Remove old elements as needed.\n\t\tlegendItems.exit().on('mouseover', null).on('click', null).on('mouseout', null).remove()\n\n\t\tif (legendClickable && addedLegendItems.size() > 1) {\n\t\t\tthis.addEventListeners()\n\t\t}\n\t}\n\n\tsortDataGroups(dataGroups: any, legendOrder: any) {\n\t\t// Sort data in user defined order\n\t\tdataGroups.sort(\n\t\t\t(dataA: { name: string }, dataB: { name: string }) =>\n\t\t\t\tlegendOrder.indexOf(dataA.name) - legendOrder.indexOf(dataB.name)\n\t\t)\n\n\t\t// If user only defined partial ordering, ordered items are placed before unordered ones\n\t\tif (legendOrder.length < dataGroups.length) {\n\t\t\tconst definedOrderIndex = dataGroups.length - legendOrder.length\n\t\t\tconst definedOrder = dataGroups.slice(definedOrderIndex)\n\n\t\t\treturn definedOrder.concat(dataGroups.slice(0, definedOrderIndex))\n\t\t}\n\t\treturn dataGroups\n\t}\n\n\taddAdditionalItem(additionalItem: any, itemConfig: any, indexOfItem: any) {\n\t\tconst { width, height } = legendConfigs.area\n\n\t\tif (itemConfig.type === LegendItemType.RADIUS) {\n\t\t\t// Circular icon\n\t\t\tadditionalItem.style('width', `${height}px`).style('height', `${height}px`)\n\t\t} else {\n\t\t\tadditionalItem.style('width', `${width}px`).style('height', `${height}px`)\n\t\t}\n\n\t\tif (itemConfig.type === LegendItemType.RADIUS) {\n\t\t\tconst { iconData, fill, stroke } = legendConfigs.radius\n\n\t\t\tconst circleEnter = additionalItem\n\t\t\t\t.attr('fill', 'none')\n\t\t\t\t.selectAll('circle')\n\t\t\t\t.data(iconData)\n\t\t\t\t.enter()\n\n\t\t\tcircleEnter\n\t\t\t\t.append('circle')\n\t\t\t\t.classed('radius', true)\n\t\t\t\t.attr('role', Roles.IMG)\n\t\t\t\t.attr('aria-label', 'radius')\n\t\t\t\t.attr('cx', (d: any) => d.cx)\n\t\t\t\t.attr('cy', (d: any) => d.cy)\n\t\t\t\t.attr('r', (d: any) => d.r)\n\t\t\t\t.style('fill', itemConfig.fill ? itemConfig.fill : fill)\n\t\t\t\t.style('stroke', itemConfig.stroke ? itemConfig.stroke : stroke)\n\t\t} else if (itemConfig.type === LegendItemType.LINE) {\n\t\t\tconst lineConfig = legendConfigs.line\n\n\t\t\tif (additionalItem.select('line.line').empty()) {\n\t\t\t\tadditionalItem\n\t\t\t\t\t.append('line')\n\t\t\t\t\t.classed(`line-${indexOfItem}`, true)\n\t\t\t\t\t.attr('role', Roles.IMG)\n\t\t\t\t\t.attr('aria-label', 'line')\n\t\t\t\t\t.attr('x1', 0)\n\t\t\t\t\t.attr('y1', lineConfig.yPosition)\n\t\t\t\t\t.attr('x2', width)\n\t\t\t\t\t.attr('y2', lineConfig.yPosition)\n\t\t\t\t\t.style('stroke', itemConfig.stroke ? itemConfig.stroke : lineConfig.stroke)\n\t\t\t\t\t.style('stroke-width', lineConfig.strokeWidth)\n\t\t\t}\n\t\t} else if (itemConfig.type === LegendItemType.AREA) {\n\t\t\tif (additionalItem.select('rect.area').empty()) {\n\t\t\t\tadditionalItem\n\t\t\t\t\t.append('rect')\n\t\t\t\t\t.classed(`area-${indexOfItem}`, true)\n\t\t\t\t\t.attr('role', Roles.IMG)\n\t\t\t\t\t.attr('aria-label', 'area')\n\t\t\t\t\t.attr('width', width)\n\t\t\t\t\t.attr('height', height)\n\t\t\t\t\t.style(\n\t\t\t\t\t\t'fill',\n\t\t\t\t\t\tindexOfItem > 3 && !itemConfig.fill ? legendConfigs.area.fill : itemConfig.fill\n\t\t\t\t\t)\n\t\t\t\t\t.style('stroke', itemConfig.stroke)\n\t\t\t}\n\t\t} else if (itemConfig.type === LegendItemType.SIZE) {\n\t\t\tconst { iconData, fill, stroke } = legendConfigs.size\n\n\t\t\tconst sizeEnter = additionalItem\n\t\t\t\t.attr('fill', 'none')\n\t\t\t\t.attr('role', Roles.IMG)\n\t\t\t\t.attr('aria-label', 'size')\n\t\t\t\t.selectAll('rect')\n\t\t\t\t.data(iconData)\n\t\t\t\t.enter()\n\n\t\t\tsizeEnter\n\t\t\t\t.append('rect')\n\t\t\t\t.classed('size', true)\n\t\t\t\t.attr('width', (d: any) => d.width)\n\t\t\t\t.attr('height', (d: any) => d.height)\n\t\t\t\t.attr('y', () => 0)\n\t\t\t\t.style('fill', itemConfig.fill ? itemConfig.fill : fill)\n\t\t\t\t.style('stroke', itemConfig.stroke ? itemConfig.stroke : stroke)\n\t\t\t\t.style('stroke-width', 1)\n\t\t} else if (itemConfig.type === LegendItemType.QUARTILE) {\n\t\t\tconst { iconData } = legendConfigs.quartile\n\n\t\t\tconst quartileEnter = additionalItem\n\t\t\t\t.selectAll('rect')\n\t\t\t\t.attr('role', Roles.IMG)\n\t\t\t\t.attr('aria-label', 'quartile')\n\t\t\t\t.data(iconData)\n\t\t\t\t.enter()\n\n\t\t\tquartileEnter\n\t\t\t\t.append('rect')\n\t\t\t\t.attr('class', (_: any, i: number) => `quartile-${i === 0 ? 'wrapper' : 'line'}`)\n\t\t\t\t.attr('x', (d: any) => d.x)\n\t\t\t\t.attr('y', (d: any) => d.y)\n\t\t\t\t.attr('width', (d: any) => d.width)\n\t\t\t\t.attr('height', (d: any) => d.height)\n\t\t} else if (itemConfig.type === LegendItemType.ZOOM) {\n\t\t\tconst { iconData, color } = getProperty(legendConfigs, 'zoom')\n\n\t\t\tconst zoomEnter = additionalItem\n\t\t\t\t.attr('role', Roles.IMG)\n\t\t\t\t.attr('aria-label', 'zoom')\n\t\t\t\t.selectAll('g.icon')\n\t\t\t\t.data(iconData)\n\t\t\t\t.enter()\n\n\t\t\t// add '+' for the magnifying icon\n\t\t\tzoomEnter\n\t\t\t\t.append('g')\n\t\t\t\t.attr('x', (d: any) => d.x)\n\t\t\t\t.attr('y', (d: any) => d.y)\n\t\t\t\t.attr('width', (d: any) => d.width)\n\t\t\t\t.attr('height', (d: any) => d.height)\n\t\t\t\t.append('polygon')\n\t\t\t\t.attr(\n\t\t\t\t\t'points',\n\t\t\t\t\t'7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82'\n\t\t\t\t)\n\t\t\t\t.attr('fill', () => (itemConfig.color ? itemConfig.color : color))\n\n\t\t\t// add the magnifying zoom icon handle/circle\n\t\t\tzoomEnter\n\t\t\t\t.append('path')\n\t\t\t\t.attr(\n\t\t\t\t\t'd',\n\t\t\t\t\t'M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z'\n\t\t\t\t)\n\t\t\t\t.attr('fill', () => (itemConfig.color ? itemConfig.color : color))\n\t\t}\n\t}\n\n\ttruncateLegendText() {\n\t\tconst svg = this.getComponentContainer()\n\n\t\tconst truncationOptions = getProperty(this.getOptions(), 'legend', 'truncation')\n\t\t// Truncation\n\t\t// get user provided custom values for truncation\n\t\tconst truncationType = getProperty(truncationOptions, 'type')\n\t\tconst truncationThreshold = getProperty(truncationOptions, 'threshold')\n\t\tconst truncationNumCharacter = getProperty(truncationOptions, 'numCharacter')\n\n\t\tconst addedLegendItemsText = svg.selectAll('div.legend-item p')\n\n\t\t// Add an ID for the checkbox to use through `aria-labelledby`\n\t\taddedLegendItemsText.attr('id', function () {\n\t\t\tconst elementToReference: any =\n\t\t\t\t(this as any).parentNode.querySelector('div.checkbox') || (this as any).parentNode\n\n\t\t\treturn elementToReference.getAttribute('aria-labelledby')\n\t\t})\n\n\t\t// truncate the legend label if it's too long\n\t\tif (truncationType !== TruncationTypes.NONE) {\n\t\t\taddedLegendItemsText.html(function (d: any) {\n\t\t\t\tconst _sanitizedLabel = sanitizeText(d.name)\n\t\t\t\tif (\n\t\t\t\t\t_sanitizedLabel.length > truncationThreshold &&\n\t\t\t\t\t_sanitizedLabel.length !== truncationNumCharacter\n\t\t\t\t) {\n\t\t\t\t\treturn truncateLabel(_sanitizedLabel, truncationType, truncationNumCharacter)\n\t\t\t\t} else {\n\t\t\t\t\treturn _sanitizedLabel\n\t\t\t\t}\n\t\t\t})\n\t\t} else {\n\t\t\taddedLegendItemsText.html((d: any) => sanitizeText(d.name))\n\t\t}\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this\n\t\tconst svg = this.getComponentContainer()\n\t\tconst options = this.getOptions()\n\t\tconst legendOptions = getProperty(options, 'legend')\n\t\tconst truncation = getProperty(legendOptions, 'truncation')\n\n\t\tsvg\n\t\t\t.selectAll('div.legend-item')\n\t\t\t.on('mouseover', function (event: MouseEvent) {\n\t\t\t\tself.services.events.dispatchEvent(Events.Legend.ITEM_HOVER, {\n\t\t\t\t\thoveredElement: select(this)\n\t\t\t\t})\n\n\t\t\t\tconst hoveredItem = select(this)\n\t\t\t\thoveredItem.select('div.checkbox').classed('hovered', true)\n\n\t\t\t\t// Show tooltip if character length is greater than threshold & there is no truncation\n\t\t\t\tconst hoveredItemData = hoveredItem.datum() as any\n\t\t\t\tif (\n\t\t\t\t\thoveredItemData.name.length > truncation.threshold &&\n\t\t\t\t\ttruncation.numCharacter < hoveredItemData.name.length &&\n\t\t\t\t\ttruncation.type !== TruncationTypes.NONE\n\t\t\t\t) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\thoveredElement: hoveredItem,\n\t\t\t\t\t\tcontent: hoveredItemData.name\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent) {\n\t\t\t\t// Emit tooltip move event only if tooltip is shown\n\t\t\t\tconst hoveredItemData = select(this).datum() as any\n\t\t\t\tif (\n\t\t\t\t\thoveredItemData.name.length > truncation.threshold &&\n\t\t\t\t\ttruncation.type !== TruncationTypes.NONE\n\t\t\t\t) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\t\tevent\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('click', function () {\n\t\t\t\tself.services.events.dispatchEvent(Events.Legend.ITEM_CLICK, {\n\t\t\t\t\tclickedElement: select(this)\n\t\t\t\t})\n\n\t\t\t\tconst clickedItem = select(this)\n\t\t\t\tconst clickedItemData = clickedItem.datum() as any\n\n\t\t\t\tself.model.toggleDataLabel(clickedItemData.name)\n\t\t\t})\n\t\t\t.on('mouseout', function () {\n\t\t\t\tconst hoveredItem = select(this)\n\t\t\t\thoveredItem.select('div.checkbox').classed('hovered', false)\n\n\t\t\t\t// Emit tooltip hide event only if tooltip is shown\n\t\t\t\tconst hoveredItemData = hoveredItem.datum() as any\n\t\t\t\tif (\n\t\t\t\t\thoveredItemData.name.length > truncation.threshold &&\n\t\t\t\t\ttruncation.type !== TruncationTypes.NONE\n\t\t\t\t) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE)\n\t\t\t\t}\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Legend.ITEM_MOUSEOUT, {\n\t\t\t\t\thoveredElement: hoveredItem\n\t\t\t\t})\n\t\t\t})\n\n\t\tsvg.selectAll('div.legend-item div.checkbox').on('keyup', function (event: KeyboardEvent) {\n\t\t\tif (event.key && event.key === 'Tab') {\n\t\t\t\t// Higlight group\n\t\t\t\tself.services.events.dispatchEvent(Events.Legend.ITEM_HOVER, {\n\t\t\t\t\thoveredElement: select(this)\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\n\t\tsvg\n\t\t\t.selectAll('div.legend-item div.checkbox')\n\t\t\t.on('keydown', function (event: KeyboardEvent, d: any) {\n\t\t\t\tif (event.key && event.key === ' ') {\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\tself.model.toggleDataLabel(d.name)\n\t\t\t\t} else if (event.key && event.key === 'Tab') {\n\t\t\t\t\t// Unhiglight group\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Legend.ITEM_MOUSEOUT, {\n\t\t\t\t\t\thoveredElement: select(this)\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\n\t\tsvg.selectAll('g.additional-item').on('mouseover', function (event: MouseEvent) {\n\t\t\tconst hoveredItem = select(this)\n\n\t\t\tconst hoveredItemData = hoveredItem.datum() as any\n\t\t\tif (hoveredItemData.name.length > truncation.threshold) {\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement: hoveredItem,\n\t\t\t\t\tcontent: hoveredItemData.name\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n}\n","import { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport type { ChartModel } from '@/model/model'\nimport { RenderTypes } from '@/interfaces/enums'\nimport type { Selection } from 'd3'\n\n// This class is used to create the clipPath to clip the chart components\n// It's necessary for zoom in/out behavior\nexport class ChartClip extends Component {\n\ttype = 'chart-clip'\n\trenderType = RenderTypes.SVG\n\n\t// Give every chart-clip a distinct ID\n\t// so they don't interfere each other in a page with multiple charts\n\tchartClipId = 'chart-clip-id-' + Math.floor(Math.random() * 99999999999)\n\n\tchartClipPath: any\n\n\tconstructor(model: ChartModel, services: any, configs?: any) {\n\t\tsuper(model, services, configs)\n\t\tthis.init()\n\t}\n\n\tinit() {\n\t\t// set unique chartClipId in this chart to model\n\t\tthis.model.set({ chartClipId: this.chartClipId }, { skipUpdate: true })\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\t// Create the clipPath\n\t\tthis.createClipPath()\n\t}\n\n\tcreateClipPath() {\n\t\tconst svg = this.parent\n\t\tconst { cartesianScales } = this.services\n\t\tif (!cartesianScales) throw new Error('Service cartesianScales was undefined')\n\t\tconst mainXScale = cartesianScales.getMainXScale()\n\t\tconst mainYScale = cartesianScales.getMainYScale()\n\n\t\tconst [xScaleStart, xScaleEnd]: number[] = mainXScale.range()\n\t\tconst [yScaleEnd, yScaleStart]: number[] = mainYScale.range()\n\n\t\t// Get height\n\t\tif (!svg) {\n\t\t\tthrow new Error('svg is undefined')\n\t\t}\n\n\t\tthis.chartClipPath = DOMUtils.appendOrSelect(\n\t\t\tsvg as Selection<SVGGraphicsElement, any, HTMLElement, any>,\n\t\t\t`clipPath.${this.type}`\n\t\t).attr('id', this.chartClipId)\n\t\tconst clipRect = DOMUtils.appendOrSelect(this.chartClipPath, `rect.${this.type}`) as Selection<\n\t\t\tany,\n\t\t\tany,\n\t\t\tHTMLElement,\n\t\t\tany\n\t\t>\n\n\t\tif (xScaleEnd - xScaleStart > 0) {\n\t\t\tclipRect\n\t\t\t\t.attr('x', xScaleStart)\n\t\t\t\t.attr('y', yScaleStart)\n\t\t\t\t.attr('width', xScaleEnd - xScaleStart)\n\t\t\t\t.attr('height', yScaleEnd - yScaleStart)\n\t\t}\n\n\t\tthis.chartClipPath.merge(clipRect).lower()\n\t}\n}\n","// Internal Imports\nimport { ChartClip } from '@/components/axes/chart-clip'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\n\n// This class is used to create the clipPath to clip the chart components\n// It's necessary for zoom in/out behavior\nexport class CanvasChartClip extends ChartClip {\n\ttype = 'canvas-chart-clip'\n\n\t// Give every chart-clip a distinct ID\n\t// so they don't interfere each other in a page with multiple charts\n\tchartClipId = 'canvas-chart-clip-id-' + Math.floor(Math.random() * 99999999999)\n\n\tcreateClipPath() {\n\t\tconst svg = this.parent\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(this.parent as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tthis.chartClipPath = DOMUtils.appendOrSelect(svg, `clipPath.${this.type}`).attr(\n\t\t\t'id',\n\t\t\tthis.chartClipId\n\t\t)\n\t\tconst clipRect = DOMUtils.appendOrSelect(this.chartClipPath, `rect.${this.type}`)\n\n\t\tclipRect.attr('x', 0).attr('y', 0).attr('width', width).attr('height', height)\n\n\t\tthis.chartClipPath.merge(clipRect).lower()\n\t}\n}\n","/**\n * Utilites to manipulate the position of elements relative to other elements\n */\nvar _a;\nexport var PLACEMENTS;\n(function (PLACEMENTS) {\n PLACEMENTS[\"LEFT\"] = \"left\";\n PLACEMENTS[\"RIGHT\"] = \"right\";\n PLACEMENTS[\"TOP\"] = \"top\";\n PLACEMENTS[\"BOTTOM\"] = \"bottom\";\n})(PLACEMENTS || (PLACEMENTS = {}));\nexport var defaultPositions = (_a = {},\n _a[PLACEMENTS.LEFT] = function (referenceOffset, target, referenceRect) { return ({\n top: referenceOffset.top - Math.round(target.offsetHeight / 2) + Math.round(referenceRect.height / 2),\n left: Math.round(referenceOffset.left - target.offsetWidth)\n }); },\n _a[PLACEMENTS.RIGHT] = function (referenceOffset, target, referenceRect) { return ({\n top: referenceOffset.top - Math.round(target.offsetHeight / 2) + Math.round(referenceRect.height / 2),\n left: Math.round(referenceOffset.left + referenceRect.width)\n }); },\n _a[PLACEMENTS.TOP] = function (referenceOffset, target, referenceRect) { return ({\n top: Math.round(referenceOffset.top - target.offsetHeight),\n left: referenceOffset.left - Math.round(target.offsetWidth / 2) + Math.round(referenceRect.width / 2)\n }); },\n _a[PLACEMENTS.BOTTOM] = function (referenceOffset, target, referenceRect) { return ({\n top: Math.round(referenceOffset.top + referenceRect.height),\n left: referenceOffset.left - Math.round(target.offsetWidth / 2) + Math.round(referenceRect.width / 2)\n }); },\n _a);\nvar windowRef = typeof window !== \"undefined\" ? window : {\n innerHeight: 0,\n scrollY: 0,\n innerWidth: 0,\n scrollX: 0\n};\nvar Position = /** @class */ (function () {\n function Position(positions) {\n if (positions === void 0) { positions = {}; }\n this.positions = defaultPositions;\n this.positions = Object.assign({}, defaultPositions, positions);\n }\n Position.prototype.getRelativeOffset = function (target) {\n // start with the initial element offsets\n var offsets = {\n left: target.offsetLeft,\n top: target.offsetTop\n };\n // get each static (i.e. not absolute or relative) offsetParent and sum the left/right offsets\n while (target.offsetParent && getComputedStyle(target.offsetParent).position === \"static\") {\n offsets.left += target.offsetLeft;\n offsets.top += target.offsetTop;\n target = target.offsetParent;\n }\n return offsets;\n };\n Position.prototype.getAbsoluteOffset = function (target) {\n var currentNode = target;\n var margins = {\n top: 0,\n left: 0\n };\n // searches for containing elements with additional margins\n while (currentNode.offsetParent) {\n var computed = getComputedStyle(currentNode.offsetParent);\n // find static elements with additional margins\n // since they tend to throw off our positioning\n // (usually this is just the body)\n if (computed.position === \"static\" &&\n computed.marginLeft &&\n computed.marginTop) {\n if (parseInt(computed.marginTop, 10)) {\n margins.top += parseInt(computed.marginTop, 10);\n }\n if (parseInt(computed.marginLeft, 10)) {\n margins.left += parseInt(computed.marginLeft, 10);\n }\n }\n currentNode = currentNode.offsetParent;\n }\n var targetRect = target.getBoundingClientRect();\n var relativeRect = document.body.getBoundingClientRect();\n return {\n top: targetRect.top - relativeRect.top + margins.top,\n left: targetRect.left - relativeRect.left + margins.left\n };\n };\n // finds the position relative to the `reference` element\n Position.prototype.findRelative = function (reference, target, placement) {\n var referenceOffset = this.getRelativeOffset(reference);\n var referenceRect = reference.getBoundingClientRect();\n return this.calculatePosition(referenceOffset, referenceRect, target, placement);\n };\n Position.prototype.findAbsolute = function (reference, target, placement) {\n var referenceOffset = this.getAbsoluteOffset(reference);\n var referenceRect = reference.getBoundingClientRect();\n return this.calculatePosition(referenceOffset, referenceRect, target, placement);\n };\n Position.prototype.findPosition = function (reference, target, placement, offsetFunction) {\n if (offsetFunction === void 0) { offsetFunction = this.getAbsoluteOffset.bind(this); }\n var referenceOffset = offsetFunction(reference);\n var referenceRect = reference.getBoundingClientRect();\n return this.calculatePosition(referenceOffset, referenceRect, target, placement);\n };\n Position.prototype.findPositionAt = function (offset, target, placement) {\n return this.calculatePosition(offset, { top: 0, left: 0, height: 0, width: 0 }, target, placement);\n };\n /**\n * Get the dimensions of an element from an AbsolutePosition and a reference element\n */\n Position.prototype.getPlacementBox = function (target, position) {\n var targetBottom = target.offsetHeight + position.top;\n var targetRight = target.offsetWidth + position.left;\n return {\n top: position.top,\n bottom: targetBottom,\n left: position.left,\n right: targetRight\n };\n };\n Position.prototype.addOffset = function (position, top, left) {\n if (top === void 0) { top = 0; }\n if (left === void 0) { left = 0; }\n return Object.assign({}, position, {\n top: position.top + top,\n left: position.left + left\n });\n };\n Position.prototype.setElement = function (element, position) {\n element.style.top = position.top + \"px\";\n element.style.left = position.left + \"px\";\n };\n Position.prototype.findBestPlacement = function (reference, target, placements, containerFunction, positionFunction) {\n var _this = this;\n if (containerFunction === void 0) { containerFunction = this.defaultContainerFunction.bind(this); }\n if (positionFunction === void 0) { positionFunction = this.findPosition.bind(this); }\n /**\n * map over the array of placements and weight them based on the percentage of visible area\n * where visible area is defined as the area not obscured by the window borders\n */\n var weightedPlacements = placements.map(function (placement) {\n var pos = positionFunction(reference, target, placement);\n var box = _this.getPlacementBox(target, pos);\n var hiddenHeight = 0;\n var hiddenWidth = 0;\n var container = containerFunction();\n // the element is exceeding from top or bottom of its container\n if (box.top < container.top) {\n hiddenHeight = container.top - box.top;\n }\n else if (box.bottom > container.height) {\n hiddenHeight = box.bottom - container.height;\n }\n // the element is exceeding from left or right of its container\n if (box.left < container.left) {\n hiddenWidth = container.left - box.left;\n }\n else if (box.right > container.width) {\n hiddenWidth = box.right - container.width;\n }\n // if one of the hidden dimensions is 0 but the other is > 0\n // we want to have a positive area, so setting the null one to 1\n if (hiddenHeight && !hiddenWidth) {\n hiddenWidth = 1;\n }\n else if (hiddenWidth && !hiddenHeight) {\n hiddenHeight = 1;\n }\n var area = target.offsetHeight * target.offsetWidth;\n var hiddenArea = hiddenHeight * hiddenWidth;\n // if visibleArea is 0 it means the element is fully outside container bounds\n // and visiblePercent will then be 0\n var visibleArea = area - hiddenArea;\n var visiblePercent = visibleArea / area;\n return {\n placement: placement,\n weight: visiblePercent\n };\n });\n // sort the placements from best to worst\n weightedPlacements.sort(function (a, b) { return b.weight - a.weight; });\n // pick the best!\n return weightedPlacements[0].placement;\n };\n Position.prototype.findBestPlacementAt = function (offset, target, placements, containerFunction) {\n var _this = this;\n if (containerFunction === void 0) { containerFunction = this.defaultContainerFunction.bind(this); }\n var positionAt = function (_, target, placement) {\n return _this.findPositionAt(offset, target, placement);\n };\n return this.findBestPlacement(null, target, placements, containerFunction, positionAt);\n };\n Position.prototype.defaultContainerFunction = function () {\n return {\n // we go with window here, because that's going to be the simple/common case\n top: 0,\n left: 0,\n height: windowRef.innerHeight,\n width: windowRef.innerWidth\n };\n };\n Position.prototype.calculatePosition = function (referenceOffset, referenceRect, target, placement) {\n if (this.positions[placement]) {\n return this.positions[placement](referenceOffset, target, referenceRect);\n }\n console.error(\"No function found for placement, defaulting to 0,0\");\n return { left: 0, top: 0 };\n };\n return Position;\n}());\nexport { Position };\nexport var position = new Position();\nexport default Position;\n//# sourceMappingURL=../src/index.js.map","import { select, pointer } from 'd3'\nimport { format } from 'date-fns/format'\nimport Position, { PLACEMENTS } from '@carbon/utils-position' // position service\nimport { getProperty, truncateLabel } from '@/tools'\nimport { zoomBar as zoomBarConfigs, tooltips as tooltipConfigs } from '@/configuration'\nimport { carbonPrefix } from '@/configuration-non-customizable' // CSS prefix\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport type { ChartModel } from '@/model/model'\nimport { Events, RenderTypes, TruncationTypes } from '@/interfaces/enums'\nimport { sanitizeHtml } from '@/utils/sanitizeHtml'\n\nexport class Tooltip extends Component {\n\ttype = 'tooltip'\n\trenderType = RenderTypes.HTML\n\n\t// flag for checking whether tooltip event listener is added or not\n\tisEventListenerAdded = false\n\ttooltip: any\n\tpositionService = new Position()\n\n\tconstructor(model: ChartModel, services: any, configs?: any) {\n\t\tsuper(model, services, configs)\n\n\t\tthis.init()\n\t}\n\n\thandleShowTooltip = (e: any) => {\n\t\tconst data = e.detail.data || e.detail.items\n\n\t\tlet defaultHTML: any\n\t\tconst formattedItems = this.formatItems(this.getItems(e))\n\n\t\tif (e.detail.content) {\n\t\t\tdefaultHTML = `<div class=\"title-tooltip\"><p>${sanitizeHtml(e.detail.content)}</p></div>`\n\t\t} else {\n\t\t\tdefaultHTML = sanitizeHtml(this.getTooltipHTML(formattedItems))\n\t\t}\n\n\t\tconst tooltipTextContainer = DOMUtils.appendOrSelect(this.tooltip, 'div.content-box')\n\n\t\t// if there is a provided tooltip HTML function call it\n\t\tif (getProperty(this.getOptions(), 'tooltip', 'customHTML')) {\n\t\t\tif (e.detail.content) {\n\t\t\t\tconst labelHTML = `<div class=\"title-tooltip\"><p>${sanitizeHtml(\n\t\t\t\t\te.detail.content\n\t\t\t\t)}</p></div>`\n\t\t\t\ttooltipTextContainer.html(labelHTML)\n\t\t\t} else {\n\t\t\t\ttooltipTextContainer.html(\n\t\t\t\t\t`<div class=\"title-tooltip\"><p>${sanitizeHtml(\n\t\t\t\t\t\tthis.model.getOptions().tooltip.customHTML(data, defaultHTML)\n\t\t\t\t\t)}</p></div>`\n\t\t\t\t)\n\t\t\t}\n\t\t} else {\n\t\t\t// Use default tooltip\n\t\t\ttooltipTextContainer.html(defaultHTML)\n\t\t}\n\n\t\t// Apply custom background colors\n\t\ttooltipTextContainer.selectAll('.datapoint-tooltip').each(function (_: any, i: number) {\n\t\t\tconst item = formattedItems[i]\n\n\t\t\tif (formattedItems[i] && formattedItems[i].color) {\n\t\t\t\tselect(this)\n\t\t\t\t\t.select('.tooltip-color')\n\t\t\t\t\t.attr('class', 'tooltip-color')\n\t\t\t\t\t.style('background-color', item.color)\n\t\t\t}\n\t\t})\n\n\t\t// Position the tooltip\n\t\tthis.positionTooltip(e)\n\n\t\t// Fade in\n\t\tthis.tooltip.classed('hidden', false).attr('aria-hidden', false)\n\t}\n\n\thandleHideTooltip = () => {\n\t\tthis.tooltip.classed('hidden', true).attr('aria-hidden', true)\n\t}\n\n\taddTooltipEventListener() {\n\t\t// listen to move-tooltip Custom Events to move the tooltip\n\t\tthis.services.events.addEventListener(Events.Tooltip.MOVE, (e: CustomEvent) => {\n\t\t\tif (this.tooltip.classed('hidden') === false) {\n\t\t\t\tthis.positionTooltip(e)\n\t\t\t}\n\t\t})\n\n\t\t// listen to show-tooltip Custom Events to render the tooltip\n\t\tthis.services.events.addEventListener(Events.Tooltip.SHOW, this.handleShowTooltip)\n\n\t\t// listen to hide-tooltip Custom Events to hide the tooltip\n\t\tthis.services.events.addEventListener(Events.Tooltip.HIDE, this.handleHideTooltip)\n\n\t\t// listen to chart-mouseout event to hide the tooltip\n\t\tthis.services.events.addEventListener(Events.Chart.MOUSEOUT, this.handleHideTooltip)\n\t}\n\n\tremoveTooltipEventListener() {\n\t\t// remove move-tooltip Custom Events\n\t\tthis.services.events.removeEventListener(Events.Tooltip.MOVE, null)\n\n\t\t// remove show-tooltip Custom Events\n\t\tthis.services.events.removeEventListener(Events.Tooltip.SHOW, this.handleShowTooltip)\n\n\t\t// remove hide-tooltip Custom Events\n\t\tthis.services.events.removeEventListener(Events.Tooltip.HIDE, this.handleHideTooltip)\n\n\t\t// remove the listener on chart-mouseout\n\t\tthis.services.events.removeEventListener(Events.Chart.MOUSEOUT, this.handleHideTooltip)\n\t}\n\n\tgetItems(e: CustomEvent) {\n\t\tif (e.detail.items) {\n\t\t\treturn e.detail.items\n\t\t}\n\n\t\treturn []\n\t}\n\n\tformatItems(items: any) {\n\t\tconst options = this.getOptions()\n\n\t\t// get user provided custom values for truncation\n\t\tconst truncationType = getProperty(options, 'tooltip', 'truncation', 'type')\n\n\t\tconst truncationThreshold = getProperty(options, 'tooltip', 'truncation', 'threshold')\n\n\t\tconst truncationNumCharacter = getProperty(options, 'tooltip', 'truncation', 'numCharacter')\n\n\t\t// truncate the label if it's too long\n\t\t// only applies to discrete type\n\t\tif (truncationType !== TruncationTypes.NONE) {\n\t\t\treturn items.map((item: any) => {\n\t\t\t\t// get width of the label icon if it exists\n\t\t\t\tconst labelIconSize = item.labelIcon ? 12 : 0\n\n\t\t\t\titem.value = item.value ? this.valueFormatter(item.value, item.label) : item.value\n\t\t\t\tif (item.label && item.label.length + labelIconSize > truncationThreshold) {\n\t\t\t\t\titem.label = truncateLabel(item.label, truncationType, truncationNumCharacter)\n\t\t\t\t}\n\n\t\t\t\tif (item.value && item.value.length > truncationThreshold) {\n\t\t\t\t\titem.value = truncateLabel(item.value, truncationType, truncationNumCharacter)\n\t\t\t\t}\n\n\t\t\t\treturn item\n\t\t\t})\n\t\t} else {\n\t\t\treturn items.map((item: any) => {\n\t\t\t\titem.value = item.value ? this.valueFormatter(item.value, item.label) : item.value\n\t\t\t\treturn item\n\t\t\t})\n\t\t}\n\t}\n\n\tgetTooltipHTML(formattedItems: any) {\n\t\treturn (\n\t\t\t`<ul class=\"multi-tooltip\">` +\n\t\t\tformattedItems\n\t\t\t\t.map(\n\t\t\t\t\t(item: any) =>\n\t\t\t\t\t\t`<li>\n\t\t\t\t\t<div class=\"datapoint-tooltip${item.bold ? ' bold' : ''}\">\n\t\t\t\t\t\t${item.class || item.color ? `<div class=\"tooltip-color ${item.class}\"></div>` : ''}\n\t\t\t\t\t\t<div class=\"label\">\n\t\t\t\t\t\t<p>${item.label || ''}</p>\n\t\t\t\t\t\t${item.labelIcon ? `<span class=\"label-icon\"/>${item.labelIcon}</span>` : ''}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t${item.value === undefined || item.value === null ? '' : `<p class=\"value\"/>${item.value}</p>`}\n\t\t\t\t\t</div>\n\t\t\t\t</li>`\n\t\t\t\t)\n\t\t\t\t.join('') +\n\t\t\t`</ul>`\n\t\t)\n\t}\n\n\tvalueFormatter(value: any, label: string) {\n\t\tconst options = this.getOptions()\n\t\tconst valueFormatter = getProperty(options, 'tooltip', 'valueFormatter')\n\n\t\tif (valueFormatter) {\n\t\t\treturn valueFormatter(value, label)\n\t\t}\n\n\t\tif (typeof value.getTime === 'function') {\n\t\t\treturn format(value, 'MMM d, yyyy')\n\t\t}\n\n\t\ttry {\n\t\t\t// it's a correct ISO format Date string\n\t\t\tif (typeof value === 'string' && /\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z/.test(value)) {\n\t\t\t\treturn format(Date.parse(value), 'MMM d, yyyy')\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t// not a valid ISO format string\n\t\t}\n\n\t\treturn value.toLocaleString()\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = false) {\n\t\tconst options = this.getOptions()\n\t\tconst isTooltipEnabled = getProperty(options, 'tooltip', 'enabled')\n\t\tif (isTooltipEnabled) {\n\t\t\t// Grab the tooltip element\n\t\t\tconst holder = select(this.services.domUtils.getHolder())\n\t\t\tconst chartprefix = getProperty(options, 'style', 'prefix')\n\t\t\tthis.tooltip = DOMUtils.appendOrSelect(holder, `div.${carbonPrefix}--${chartprefix}--tooltip`)\n\n\t\t\tthis.tooltip.style('max-width', null).attr('role', 'tooltip')\n\n\t\t\tif (!this.isEventListenerAdded) {\n\t\t\t\tthis.addTooltipEventListener()\n\t\t\t\tthis.isEventListenerAdded = true\n\t\t\t}\n\t\t\tthis.tooltip.classed('hidden', true)\n\t\t} else if (!isTooltipEnabled && this.isEventListenerAdded) {\n\t\t\t// remove tooltip eventListener\n\t\t\tthis.removeTooltipEventListener()\n\t\t\tthis.isEventListenerAdded = false\n\t\t}\n\t}\n\n\tpositionTooltip(e: CustomEvent) {\n\t\tconst holder = this.services.domUtils.getHolder()\n\t\tconst target = this.tooltip.node()\n\t\tconst options = this.getOptions()\n\t\tconst isTopZoomBarEnabled = getProperty(options, 'zoomBar', 'top', 'enabled')\n\n\t\tlet mouseRelativePos = getProperty(e, 'detail', 'mousePosition')\n\t\tif (!mouseRelativePos) {\n\t\t\tmouseRelativePos = pointer(getProperty(e, 'detail', 'event'), holder)\n\t\t} else {\n\t\t\tconst zoombarType = getProperty(options, 'zoomBar', 'top', 'type') as\n\t\t\t\t| 'graph_view'\n\t\t\t\t| 'slider_view'\n\t\t\tconst zoombarHeight = zoomBarConfigs.height[zoombarType]\n\n\t\t\t// if the mouse position is from event (ruler)\n\t\t\t// we need add zoom bar height\n\t\t\tif (isTopZoomBarEnabled) {\n\t\t\t\tmouseRelativePos[1] += zoombarHeight + zoomBarConfigs.spacerHeight\n\n\t\t\t\t// TODO - we need to add toolbar height when toolbar is available\n\t\t\t}\n\t\t}\n\n\t\tconst holderWidth = holder.offsetWidth\n\t\tconst holderHeight = holder.offsetHeight\n\n\t\tlet bestPlacementOption: any\n\t\tif (mouseRelativePos[0] / holderWidth > 0.9) {\n\t\t\tbestPlacementOption = PLACEMENTS.LEFT\n\t\t} else if (mouseRelativePos[0] / holderWidth < 0.1) {\n\t\t\tbestPlacementOption = PLACEMENTS.RIGHT\n\t\t} else {\n\t\t\t// Find out whether tooltip should be shown on the left or right side\n\t\t\tbestPlacementOption = this.positionService.findBestPlacementAt(\n\t\t\t\t{\n\t\t\t\t\tleft: mouseRelativePos[0],\n\t\t\t\t\ttop: mouseRelativePos[1]\n\t\t\t\t},\n\t\t\t\ttarget,\n\t\t\t\t[PLACEMENTS.RIGHT, PLACEMENTS.LEFT, PLACEMENTS.TOP, PLACEMENTS.BOTTOM],\n\t\t\t\t() => ({\n\t\t\t\t\ttop: undefined, // properties were never set to optional (probably should)\n\t\t\t\t\tleft: undefined, // ditto\n\t\t\t\t\twidth: holderWidth,\n\t\t\t\t\theight: holderHeight\n\t\t\t\t})\n\t\t\t)\n\t\t}\n\n\t\tlet { horizontalOffset } = tooltipConfigs\n\t\tif (bestPlacementOption === PLACEMENTS.LEFT) {\n\t\t\thorizontalOffset *= -1\n\t\t}\n\n\t\t// Get coordinates to where tooltip should be positioned\n\t\tconst pos = this.positionService.findPositionAt(\n\t\t\t{\n\t\t\t\tleft: mouseRelativePos[0] + horizontalOffset,\n\t\t\t\ttop: mouseRelativePos[1]\n\t\t\t},\n\t\t\ttarget,\n\t\t\tbestPlacementOption\n\t\t)\n\n\t\tthis.positionService.setElement(target, pos)\n\t}\n}\n","import { select } from 'd3'\nimport { Service } from './service'\nimport { Events } from '@/interfaces/enums'\nimport { canvasZoomSettings } from '@/configuration'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\n\nexport class CanvasZoom extends Service {\n\tprotected model: any\n\n\t/**\n\t * focal: object to zoom into\n\t * canvasElements: all the elements to translate and zoom on the chart area\n\t * zoomSettings: object containing duration, easing and zoomlevel for the zoom behaviours\n\t * */\n\tzoomIn(focal: any, canvasElements: any, zoomSettings?: any) {\n\t\tlet x: number\n\t\tlet y: number\n\t\tlet zoomLevel: number\n\t\tconst settings = zoomSettings ? zoomSettings : canvasZoomSettings\n\n\t\tif (focal) {\n\t\t\tx = focal.x\n\t\t\ty = focal.y\n\t\t\tzoomLevel = 2\n\t\t}\n\n\t\t// the 'viewport' size of the chart\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(this.services.domUtils.getHolder(), {\n\t\t\tuseClientDimensions: true\n\t\t})\n\n\t\tcanvasElements\n\t\t\t.transition()\n\t\t\t.duration(settings.duration)\n\t\t\t.ease(settings.ease)\n\t\t\t.attr(\n\t\t\t\t'transform',\n\t\t\t\t`translate(${width / 2}, ${height / 2}) scale(${zoomLevel}) translate(${-x},${-y})`\n\t\t\t)\n\n\t\t// Dispatch canvas zoom in event\n\t\tthis.services.events.dispatchEvent(Events.CanvasZoom.CANVAS_ZOOM_IN, {\n\t\t\telement: select(focal)\n\t\t})\n\t}\n\n\tzoomOut(canvasElements: any, zoomSettings?: any) {\n\t\tconst settings = zoomSettings ? zoomSettings : canvasZoomSettings\n\t\tcanvasElements\n\t\t\t.transition()\n\t\t\t.duration(settings.duration)\n\t\t\t.ease(settings.ease)\n\t\t\t.attr('transform', '')\n\n\t\t// Dispatch canvas zoom out event\n\t\tthis.services.events.dispatchEvent(Events.CanvasZoom.CANVAS_ZOOM_OUT)\n\t}\n}\n","import { Service } from '@/services/service'\n\nexport class Events extends Service {\n\t// DOM Event target\n\tdocumentFragment: DocumentFragment\n\n\tinit() {\n\t\t// Setup the event fragment on the DOM\n\t\tthis.documentFragment = document.createDocumentFragment()\n\t}\n\n\taddEventListener(type: string, listener: EventListenerOrEventListenerObject) {\n\t\tthis.documentFragment.addEventListener(type, listener)\n\t}\n\n\tremoveEventListener(type: string, listener: EventListenerOrEventListenerObject) {\n\t\tthis.documentFragment.removeEventListener(type, listener)\n\t}\n\n\tdispatchEvent(eventType: string, eventDetail?: object) {\n\t\tlet newEvent: any\n\t\tif (eventDetail) {\n\t\t\tnewEvent = new CustomEvent(eventType, {\n\t\t\t\tdetail: eventDetail\n\t\t\t})\n\t\t} else {\n\t\t\tnewEvent = document.createEvent('Event')\n\t\t\tnewEvent.initEvent(eventType, false, true)\n\t\t}\n\n\t\tthis.documentFragment.dispatchEvent(newEvent)\n\t}\n}\n","import { Service } from '@/services/service'\nimport { ChartModel } from '@/model/model'\n\nexport class Files extends Service {\n\tconstructor(model: ChartModel, services: any) {\n\t\tsuper(model, services)\n\t}\n\n\tdownloadCSV(content: any, filename: string) {\n\t\tconst anchor = document.createElement('a')\n\t\tconst mimeType = 'text/csv;encoding:utf-8'\n\n\t\tif (navigator['msSaveBlob']) {\n\t\t\t// Internet Explorer 10\n\t\t\tnavigator['msSaveBlob'](\n\t\t\t\tnew Blob([content], {\n\t\t\t\t\ttype: mimeType\n\t\t\t\t}),\n\t\t\t\tfilename\n\t\t\t)\n\t\t} else if (URL && 'download' in anchor) {\n\t\t\t// HTML5\n\t\t\tconst href = URL.createObjectURL(\n\t\t\t\tnew Blob([content], {\n\t\t\t\t\ttype: mimeType\n\t\t\t\t})\n\t\t\t)\n\t\t\tanchor.href = href\n\t\t\tanchor.setAttribute('download', filename)\n\n\t\t\t// Add anchor to body\n\t\t\tdocument.body.appendChild(anchor)\n\n\t\t\t// Click anchor\n\t\t\tanchor.click()\n\n\t\t\t// Remove anchor from body\n\t\t\tdocument.body.removeChild(anchor)\n\t\t\tURL.revokeObjectURL(href)\n\t\t} else {\n\t\t\tlocation.href = `data:application/octet-stream,${encodeURIComponent(content)}`\n\t\t}\n\t}\n\n\tdownloadImage(uri: string, name: string) {\n\t\tconst link = document.createElement('a')\n\t\tlink.download = name\n\t\tlink.href = uri\n\t\tdocument.body.appendChild(link)\n\t\tlink.click()\n\t\tdocument.body.removeChild(link)\n\t}\n}\n","import { Service } from '@/services/service'\n\nexport class GradientUtils extends Service {\n\tstatic appendOrUpdateLinearGradient(configs: any) {\n\t\tlet lg = configs.svg.select(`defs linearGradient#${configs.id}`)\n\t\tif (lg.empty()) {\n\t\t\tlg = configs.svg\n\t\t\t\t.append('defs')\n\t\t\t\t.append('linearGradient')\n\t\t\t\t.attr('id', configs.id)\n\t\t\t\t.attr('x1', configs.x1)\n\t\t\t\t.attr('x2', configs.x2)\n\t\t\t\t.attr('y1', configs.y1)\n\t\t\t\t.attr('y2', configs.y2)\n\t\t}\n\n\t\tlg.selectAll('stop').remove()\n\t\tlg.selectAll('stop')\n\t\t\t.data(configs.stops)\n\t\t\t.enter()\n\t\t\t.append('stop')\n\t\t\t.attr('offset', (d: any) => d.offset)\n\t\t\t.style('stop-color', (d: any) => d.color)\n\t\t\t.style('stop-opacity', (d: any) => d.opacity)\n\t}\n\n\tstatic getOffsetRatio(domain: any) {\n\t\tconst offsetRatio =\n\t\t\t((Math.abs(domain[1]) * 100) / Math.abs(domain[0] - domain[1])).toFixed(2) + '%'\n\t\treturn offsetRatio\n\t}\n\n\tstatic getStops(domain: any, color: string) {\n\t\tconst need3Stops = domain[0] < 0 && domain[1] > 0\n\t\tlet stops: object[] = [\n\t\t\t{\n\t\t\t\toffset: '0%',\n\t\t\t\tcolor: color,\n\t\t\t\topacity: '0.6'\n\t\t\t},\n\t\t\t{\n\t\t\t\toffset: '80%',\n\t\t\t\tcolor: color,\n\t\t\t\topacity: '0'\n\t\t\t}\n\t\t]\n\n\t\tif (need3Stops) {\n\t\t\tstops = [\n\t\t\t\t{\n\t\t\t\t\toffset: '0%',\n\t\t\t\t\tcolor: color,\n\t\t\t\t\topacity: '0.6'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\toffset: GradientUtils.getOffsetRatio(domain),\n\t\t\t\t\tcolor: color,\n\t\t\t\t\topacity: '0'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\toffset: '100%',\n\t\t\t\t\tcolor: color,\n\t\t\t\t\topacity: '0.6'\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t\treturn stops\n\t}\n}\n","import { getProperty } from '@/tools'\nimport { transitions as transitionConfigs } from '@/configuration'\nimport { Service } from '@/services/service'\nimport { Events } from '@/interfaces/enums'\nimport type { Transition } from 'd3'\n\nexport interface setupTransitionConfigs {\n\ttransition?: any // d3 types are causing issues here, hence why using `any`\n\tname?: string\n\tanimate?: boolean\n}\n\nexport class Transitions extends Service {\n\tpendingTransitions: Record<number, Transition<any, any, any, any>> = {}\n\n\tinit() {\n\t\tthis.services.events?.addEventListener(Events.Model.UPDATE, () => {\n\t\t\tthis.pendingTransitions = {}\n\t\t})\n\t}\n\n\tsetupTransition({ transition: t, name, animate }: setupTransitionConfigs) {\n\t\tthis.pendingTransitions[t._id] = t\n\t\tt.on('end interrupt cancel', () => {\n\t\t\tdelete this.pendingTransitions[t._id]\n\t\t})\n\n\t\tif (this.model.getOptions().animations === false || animate === false) {\n\t\t\treturn t.duration(0)\n\t\t}\n\n\t\treturn t.duration(\n\t\t\tgetProperty(transitionConfigs, name, 'duration') || transitionConfigs.default.duration\n\t\t)\n\t}\n\n\tgetPendingTransitions() {\n\t\treturn this.pendingTransitions\n\t}\n}\n","import { getProperty } from '@/tools'\nimport { ChartModel } from '@/model/model'\nimport { ChartConfig } from '@/interfaces/model'\nimport { BaseChartOptions } from '@/interfaces/charts'\nimport {\n\tLayoutGrowth,\n\tLayoutAlignItems,\n\tLayoutDirection,\n\tLegendOrientations,\n\tEvents as ChartEvents,\n\tRenderTypes\n} from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Toolbar } from '@/components/axes/toolbar'\nimport { LayoutComponent } from '@/components/layout'\nimport { Spacer } from '@/components/layout/spacer'\nimport { Modal } from '@/components/essentials/modal'\nimport { Title } from '@/components/essentials/title'\nimport { Legend } from '@/components/essentials/legend'\nimport { CanvasChartClip } from '@/components/essentials/canvas-chart-clip'\nimport { Tooltip } from '@/components/essentials/tooltip'\nimport { CanvasZoom } from '@/services/canvas-zoom'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { Events } from '@/services/essentials/events'\nimport { Files } from '@/services/essentials/files'\nimport { GradientUtils } from '@/services/essentials/gradient-utils'\nimport { Transitions } from '@/services/essentials/transitions'\n\nexport class Chart {\n\tcomponents: Component[] = []\n\tservices: any = {\n\t\tcanvasZoom: CanvasZoom,\n\t\tdomUtils: DOMUtils,\n\t\tevents: Events,\n\t\tfiles: Files,\n\t\tgradientUtils: GradientUtils,\n\t\ttransitions: Transitions\n\t}\n\tmodel: ChartModel = new ChartModel(this.services)\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<BaseChartOptions>) {\n\t\t// Allow for subclasses to override the constructor with additional parameters or initialization logic without breaking the API contract of the Chart class\n\t}\n\n\t// Contains the code that uses properties that are overridable by the super-class\n\tinit(holder: HTMLDivElement, chartConfigs: ChartConfig<BaseChartOptions>) {\n\t\t// Store the holder in the model\n\t\tthis.model.set({ holder }, { skipUpdate: true })\n\n\t\t// Initialize all services\n\t\tObject.keys(this.services).forEach(serviceName => {\n\t\t\tconst serviceObj = this.services[serviceName]\n\t\t\tthis.services[serviceName] = new serviceObj(this.model, this.services)\n\t\t})\n\n\t\t// Call update() when model has been updated\n\t\tthis.services.events.addEventListener(ChartEvents.Model.UPDATE, (e: CustomEvent) => {\n\t\t\tconst animate = !!getProperty(e, 'detail', 'animate')\n\t\t\tthis.update(animate)\n\t\t})\n\n\t\t// Set model data & options\n\t\tthis.model.setData(chartConfigs.data)\n\n\t\t// Set chart resize event listener\n\t\tthis.services.events.addEventListener(ChartEvents.Chart.RESIZE, () => {\n\t\t\tthis.update(false)\n\t\t})\n\n\t\tthis.components = this.getComponents()\n\n\t\tthis.update()\n\t}\n\n\tgetComponents(): Component[] {\n\t\tconsole.error('getComponents() method is not implemented')\n\n\t\treturn []\n\t}\n\n\tupdate(animate = true) {\n\t\t// Called 4 times whenever a chart is displayed\n\t\tif (!this.components) {\n\t\t\treturn\n\t\t}\n\n\t\t// Update all services\n\t\tObject.keys(this.services).forEach((serviceName: string) => {\n\t\t\tconst serviceObj = this.services[serviceName]\n\t\t\tserviceObj.update()\n\t\t})\n\n\t\t// Render all components\n\t\tthis.components.forEach(component => component.render(animate))\n\n\t\t// Asynchronously dispatch a \"render-finished\" event\n\t\t// This is needed because of d3-transitions\n\t\t// Since at the start of the transition\n\t\t// Elements do not hold their final size or position\n\t\tconst pendingTransitions = this.services.transitions.getPendingTransitions()\n\t\tconst promises = Object.keys(pendingTransitions).map(transitionID => {\n\t\t\tconst transition = pendingTransitions[transitionID]\n\t\t\treturn transition.end().catch((e: any) => e) // Skip rejects since we don't care about those;\n\t\t})\n\n\t\tPromise.all(promises).then(() =>\n\t\t\tthis.services.events.dispatchEvent(ChartEvents.Chart.RENDER_FINISHED)\n\t\t)\n\t}\n\n\tdestroy() {\n\t\t// Call the destroy() method on all components\n\t\tthis.components.forEach(component => component.destroy())\n\n\t\t// Remove the chart holder\n\t\tthis.services.domUtils.getHolder().remove()\n\n\t\tthis.model.set({ destroyed: true }, { skipUpdate: true })\n\t}\n\n\tprotected getChartComponents(graphFrameComponents: any[], configs?: object) {\n\t\tconst options = this.model.getOptions()\n\n\t\tconst toolbarEnabled = getProperty(options, 'toolbar', 'enabled')\n\n\t\tconst legendComponent = {\n\t\t\tid: 'legend',\n\t\t\tcomponents: [new Legend(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\t// if canvas zoom is enabled\n\t\tconst isZoomEnabled = getProperty(options, 'canvasZoom', 'enabled')\n\n\t\tif (isZoomEnabled && isZoomEnabled === true) {\n\t\t\tgraphFrameComponents.push(new CanvasChartClip(this.model, this.services))\n\t\t}\n\n\t\tconst titleAvailable = !!this.model.getOptions().title\n\t\tconst titleComponent = {\n\t\t\tid: 'title',\n\t\t\tcomponents: [new Title(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.STRETCH\n\t\t}\n\n\t\tconst toolbarComponent = {\n\t\t\tid: 'toolbar',\n\t\t\tcomponents: [new Toolbar(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst headerComponent = {\n\t\t\tid: 'header',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t// always add title to keep layout correct\n\t\t\t\t\t\ttitleComponent,\n\t\t\t\t\t\t...(toolbarEnabled ? [toolbarComponent] : [])\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: LayoutDirection.ROW,\n\t\t\t\t\t\talignItems: LayoutAlignItems.CENTER\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst graphFrameComponent = {\n\t\t\tid: 'graph-frame',\n\t\t\tcomponents: graphFrameComponents,\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t\trenderType: getProperty(configs, 'graphFrameRenderType') || RenderTypes.SVG\n\t\t}\n\n\t\tconst isLegendEnabled =\n\t\t\tgetProperty(configs, 'excludeLegend') !== true && options.legend.enabled !== false\n\t\t// TODO: REUSE BETWEEN AXISCHART & CHART\n\t\t// Decide the position of the legend in reference to the chart\n\t\tlet fullFrameComponentDirection = LayoutDirection.COLUMN\n\t\tif (isLegendEnabled) {\n\t\t\tconst legendPosition = getProperty(options, 'legend', 'position')\n\t\t\tif (legendPosition === 'left') {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW\n\n\t\t\t\tif (!options.legend.orientation) {\n\t\t\t\t\toptions.legend.orientation = LegendOrientations.VERTICAL\n\t\t\t\t}\n\t\t\t} else if (legendPosition === 'right') {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW_REVERSE\n\n\t\t\t\tif (!options.legend.orientation) {\n\t\t\t\t\toptions.legend.orientation = LegendOrientations.VERTICAL\n\t\t\t\t}\n\t\t\t} else if (legendPosition === 'bottom') {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.COLUMN_REVERSE\n\t\t\t}\n\t\t}\n\n\t\tconst legendSpacerComponent = {\n\t\t\tid: 'spacer',\n\t\t\tcomponents: [new Spacer(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst fullFrameComponent = {\n\t\t\tid: 'full-frame',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t...(isLegendEnabled ? [legendComponent] : []),\n\t\t\t\t\t\t...(isLegendEnabled ? [legendSpacerComponent] : []),\n\t\t\t\t\t\tgraphFrameComponent\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: fullFrameComponentDirection\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.STRETCH\n\t\t}\n\n\t\t// Add chart title if it exists\n\t\tconst topLevelLayoutComponents: any[] = []\n\n\t\tif (titleAvailable || toolbarEnabled) {\n\t\t\ttopLevelLayoutComponents.push(headerComponent)\n\n\t\t\tconst titleSpacerComponent = {\n\t\t\t\tid: 'spacer',\n\t\t\t\tcomponents: [\n\t\t\t\t\tnew Spacer(this.model, this.services, toolbarEnabled ? { size: 15 } : undefined)\n\t\t\t\t],\n\t\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t\t}\n\n\t\t\ttopLevelLayoutComponents.push(titleSpacerComponent)\n\t\t}\n\t\ttopLevelLayoutComponents.push(fullFrameComponent)\n\n\t\treturn [\n\t\t\tnew Tooltip(this.model, this.services),\n\t\t\tnew Modal(this.model, this.services),\n\t\t\tnew LayoutComponent(this.model, this.services, topLevelLayoutComponents, {\n\t\t\t\tdirection: LayoutDirection.COLUMN\n\t\t\t})\n\t\t]\n\t}\n}\n","import { cloneDeep, uniq } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { ChartModel } from './model'\nimport { ScaleTypes, AxisPositions, AxisFlavor } from '@/interfaces/enums'\n\n/**\n * This supports adding X and Y Cartesian[2D] zoom data to a ChartModel\n * */\nexport class ChartModelCartesian extends ChartModel {\n\taxisFlavor = AxisFlavor.DEFAULT // can't be protected as it's used by two-dimensional-axes.ts\n\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\t// get the scales information\n\t// needed for getTabularArray()\n\tprotected assignRangeAndDomains() {\n\t\tconst { cartesianScales } = this.services\n\t\tconst options = this.getOptions()\n\t\tconst isDualAxes = cartesianScales.isDualAxes()\n\n\t\tconst scales = {\n\t\t\tprimaryDomain: cartesianScales.domainAxisPosition,\n\t\t\tprimaryRange: cartesianScales.rangeAxisPosition,\n\t\t\tsecondaryDomain: null as any,\n\t\t\tsecondaryRange: null as any\n\t\t}\n\t\tif (isDualAxes) {\n\t\t\tscales.secondaryDomain = cartesianScales.secondaryDomainAxisPosition\n\t\t\tscales.secondaryRange = cartesianScales.secondaryRangeAxisPosition\n\t\t}\n\n\t\tObject.keys(scales).forEach(\n\t\t\t(scale: 'primaryDomain' | 'primaryRange' | 'secondaryDomain' | 'secondaryRange') => {\n\t\t\t\tconst position = scales[scale]\n\t\t\t\tif (cartesianScales.scales[position]) {\n\t\t\t\t\tscales[scale] = {\n\t\t\t\t\t\tposition: position,\n\t\t\t\t\t\tlabel: cartesianScales.getScaleLabel(position),\n\t\t\t\t\t\tidentifier: getProperty(options, 'axes', position, 'mapsTo')\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tscales[scale] = null\n\t\t\t\t}\n\t\t\t}\n\t\t)\n\n\t\treturn scales\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst { primaryDomain, primaryRange, secondaryDomain, secondaryRange } =\n\t\t\tthis.assignRangeAndDomains()\n\n const headers = [\n\t\t\t'Group',\n\t\t\tprimaryDomain.label,\n\t\t\tprimaryRange.label,\n\t\t\t...(secondaryDomain ? [secondaryDomain.label] : []),\n\t\t\t...(secondaryRange ? [secondaryRange.label] : [])\n\t\t]\n\t\tconst cells = displayData.map((datum: any) => [\n\t\t\tdatum[groupMapsTo],\n\t\t\tdatum[primaryDomain.identifier] === null ? '–' : datum[primaryDomain.identifier],\n\t\t\tdatum[primaryRange.identifier] === null || isNaN(datum[primaryRange.identifier])\n\t\t\t\t? '–'\n\t\t\t\t: datum[primaryRange.identifier].toLocaleString(),\n\t\t\t...(secondaryDomain\n\t\t\t\t? [\n\t\t\t\t\t\tdatum[secondaryDomain.identifier] === null\n\t\t\t\t\t\t\t? '–'\n\t\t\t\t\t\t\t: datum[secondaryDomain.identifier]\n\t\t\t\t ]\n\t\t\t\t: []),\n\t\t\t...(secondaryRange\n\t\t\t\t? [\n\t\t\t\t\t\tdatum[secondaryRange.identifier] === null || isNaN(datum[secondaryRange.identifier])\n\t\t\t\t\t\t\t? '–'\n\t\t\t\t\t\t\t: datum[secondaryRange.identifier]\n\t\t\t\t ]\n\t\t\t\t: [])\n\t\t])\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n\n\tsetData(newData: any) {\n\t\tlet data: any\n\t\tif (newData) {\n\t\t\tdata = super.setData(newData)\n\t\t\tif (getProperty(this.getOptions(), 'zoomBar', AxisPositions.TOP, 'enabled')) {\n\t\t\t\t// get pre-defined zoom bar data\n\t\t\t\tconst definedZoomBarData = getProperty(\n\t\t\t\t\tthis.getOptions(),\n\t\t\t\t\t'zoomBar',\n\t\t\t\t\tAxisPositions.TOP,\n\t\t\t\t\t'data'\n\t\t\t\t)\n\t\t\t\t// if we have zoom bar data we need to update it as well\n\t\t\t\t// with pre-defined zoom bar data\n\t\t\t\tthis.setZoomBarData(definedZoomBarData)\n\t\t\t}\n\t\t}\n\n\t\treturn data\n\t}\n\n\t/**\n\t * @param zoomBarData any special zoom bar data to use instead of the model data\n\t */\n\tsetZoomBarData(newZoomBarData?: any) {\n\t\tconst sanitizedData = newZoomBarData\n\t\t\t? this.sanitize(cloneDeep(newZoomBarData))\n\t\t\t: this.getDisplayData() // if we're not passed explicit zoom data use the model\n\n\t\tlet zoomBarNormalizedValues = sanitizedData\n\n\t\tconst { cartesianScales } = this.services\n\t\tif (sanitizedData && cartesianScales.domainAxisPosition && cartesianScales.rangeAxisPosition) {\n\t\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier()\n\t\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier()\n\t\t\t// get all dates (Number) in displayData\n\t\t\tlet allDates = sanitizedData.map((datum: any) => datum[domainIdentifier].getTime())\n\t\t\tallDates = uniq(allDates).sort()\n\n\t\t\t// Go through all date values\n\t\t\t// And get corresponding data from each dataset\n\t\t\tzoomBarNormalizedValues = allDates.map((date: Date) => {\n\t\t\t\tlet sum = 0\n\t\t\t\tconst datum: any = {}\n\n\t\t\t\tsanitizedData.forEach((data: any) => {\n\t\t\t\t\tif (data[domainIdentifier].getTime() === date) {\n\t\t\t\t\t\tsum += data[rangeIdentifier]\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tdatum[domainIdentifier] = new Date(date)\n\t\t\t\tdatum[rangeIdentifier] = sum\n\n\t\t\t\treturn datum\n\t\t\t})\n\t\t}\n\n\t\tthis.set({ zoomBarData: zoomBarNormalizedValues })\n\t}\n\n\tgetZoomBarData() {\n\t\treturn this.get('zoomBarData')\n\t}\n\n\tprotected sanitizeDateValues(data: any) {\n\t\tconst options = this.getOptions()\n\n\t\tif (!options.axes) {\n\t\t\treturn data\n\t\t}\n\n\t\tconst keysToCheck: any[] = []\n\t\tObject.keys(AxisPositions).forEach((axisPositionKey: keyof typeof AxisPositions) => {\n\t\t\tconst axisPosition = AxisPositions[axisPositionKey]\n\t\t\tconst axisOptions = options.axes[axisPosition]\n\n\t\t\tif (axisOptions && axisOptions.scaleType === ScaleTypes.TIME) {\n\t\t\t\tconst axisMapsTo = axisOptions.mapsTo\n\n\t\t\t\tif (axisMapsTo !== null || axisMapsTo !== undefined) {\n\t\t\t\t\tkeysToCheck.push(axisMapsTo)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\tif (keysToCheck.length > 0) {\n\t\t\t// Check all datapoints and sanitize dates\n\t\t\tdata.forEach((datum: any) => {\n\t\t\t\tkeysToCheck.forEach((key: any) => {\n\t\t\t\t\tif (getProperty(datum, key, 'getTime') === null) {\n\t\t\t\t\t\tdatum[key] = new Date(datum[key])\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t\t}\n\n\t\treturn data\n\t}\n\n\tprotected sanitize(data: any) {\n\t\tdata = super.sanitize(data)\n\t\tdata = this.sanitizeDateValues(data)\n\n\t\treturn data\n\t}\n}\n","// Internal Imports\nimport { ChartModelCartesian } from './cartesian-charts'\n\n/**\n * Alluvial chart model layer\n */\nexport class AlluvialChartModel extends ChartModelCartesian {\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\n\t\t// Sort array by source to get a close depiction of the alluvial chart\n\t\tdisplayData.sort((a: any, b: any) => a['source'].localeCompare(b['source']))\n\t\tconst headers = ['Source', 'Target', 'Value']\n\t\tconst cells = [\n\t\t\t...displayData.map((datum: any) => [datum['source'], datum['target'], datum['value']])\n\t\t]\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\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 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 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","import {min} from \"d3-array\";\n\nfunction targetDepth(d) {\n return d.target.depth;\n}\n\nexport function left(node) {\n return node.depth;\n}\n\nexport function right(node, n) {\n return n - 1 - node.height;\n}\n\nexport function justify(node, n) {\n return node.sourceLinks.length ? node.depth : n - 1;\n}\n\nexport function center(node) {\n return node.targetLinks.length ? node.depth\n : node.sourceLinks.length ? min(node.sourceLinks, targetDepth) - 1\n : 0;\n}\n","export default function constant(x) {\n return function() {\n return x;\n };\n}\n","import {max, min, sum} from \"d3-array\";\nimport {justify} from \"./align.js\";\nimport constant from \"./constant.js\";\n\nfunction ascendingSourceBreadth(a, b) {\n return ascendingBreadth(a.source, b.source) || a.index - b.index;\n}\n\nfunction ascendingTargetBreadth(a, b) {\n return ascendingBreadth(a.target, b.target) || a.index - b.index;\n}\n\nfunction ascendingBreadth(a, b) {\n return a.y0 - b.y0;\n}\n\nfunction value(d) {\n return d.value;\n}\n\nfunction defaultId(d) {\n return d.index;\n}\n\nfunction defaultNodes(graph) {\n return graph.nodes;\n}\n\nfunction defaultLinks(graph) {\n return graph.links;\n}\n\nfunction find(nodeById, id) {\n const node = nodeById.get(id);\n if (!node) throw new Error(\"missing: \" + id);\n return node;\n}\n\nfunction computeLinkBreadths({nodes}) {\n for (const node of nodes) {\n let y0 = node.y0;\n let y1 = y0;\n for (const link of node.sourceLinks) {\n link.y0 = y0 + link.width / 2;\n y0 += link.width;\n }\n for (const link of node.targetLinks) {\n link.y1 = y1 + link.width / 2;\n y1 += link.width;\n }\n }\n}\n\nexport default function Sankey() {\n let x0 = 0, y0 = 0, x1 = 1, y1 = 1; // extent\n let dx = 24; // nodeWidth\n let dy = 8, py; // nodePadding\n let id = defaultId;\n let align = justify;\n let sort;\n let linkSort;\n let nodes = defaultNodes;\n let links = defaultLinks;\n let iterations = 6;\n\n function sankey() {\n const graph = {nodes: nodes.apply(null, arguments), links: links.apply(null, arguments)};\n computeNodeLinks(graph);\n computeNodeValues(graph);\n computeNodeDepths(graph);\n computeNodeHeights(graph);\n computeNodeBreadths(graph);\n computeLinkBreadths(graph);\n return graph;\n }\n\n sankey.update = function(graph) {\n computeLinkBreadths(graph);\n return graph;\n };\n\n sankey.nodeId = function(_) {\n return arguments.length ? (id = typeof _ === \"function\" ? _ : constant(_), sankey) : id;\n };\n\n sankey.nodeAlign = function(_) {\n return arguments.length ? (align = typeof _ === \"function\" ? _ : constant(_), sankey) : align;\n };\n\n sankey.nodeSort = function(_) {\n return arguments.length ? (sort = _, sankey) : sort;\n };\n\n sankey.nodeWidth = function(_) {\n return arguments.length ? (dx = +_, sankey) : dx;\n };\n\n sankey.nodePadding = function(_) {\n return arguments.length ? (dy = py = +_, sankey) : dy;\n };\n\n sankey.nodes = function(_) {\n return arguments.length ? (nodes = typeof _ === \"function\" ? _ : constant(_), sankey) : nodes;\n };\n\n sankey.links = function(_) {\n return arguments.length ? (links = typeof _ === \"function\" ? _ : constant(_), sankey) : links;\n };\n\n sankey.linkSort = function(_) {\n return arguments.length ? (linkSort = _, sankey) : linkSort;\n };\n\n sankey.size = function(_) {\n return arguments.length ? (x0 = y0 = 0, x1 = +_[0], y1 = +_[1], sankey) : [x1 - x0, y1 - y0];\n };\n\n sankey.extent = function(_) {\n return arguments.length ? (x0 = +_[0][0], x1 = +_[1][0], y0 = +_[0][1], y1 = +_[1][1], sankey) : [[x0, y0], [x1, y1]];\n };\n\n sankey.iterations = function(_) {\n return arguments.length ? (iterations = +_, sankey) : iterations;\n };\n\n function computeNodeLinks({nodes, links}) {\n for (const [i, node] of nodes.entries()) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n }\n const nodeById = new Map(nodes.map((d, i) => [id(d, i, nodes), d]));\n for (const [i, link] of links.entries()) {\n link.index = i;\n let {source, target} = link;\n if (typeof source !== \"object\") source = link.source = find(nodeById, source);\n if (typeof target !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n }\n if (linkSort != null) {\n for (const {sourceLinks, targetLinks} of nodes) {\n sourceLinks.sort(linkSort);\n targetLinks.sort(linkSort);\n }\n }\n }\n\n function computeNodeValues({nodes}) {\n for (const node of nodes) {\n node.value = node.fixedValue === undefined\n ? Math.max(sum(node.sourceLinks, value), sum(node.targetLinks, value))\n : node.fixedValue;\n }\n }\n\n function computeNodeDepths({nodes}) {\n const n = nodes.length;\n let current = new Set(nodes);\n let next = new Set;\n let x = 0;\n while (current.size) {\n for (const node of current) {\n node.depth = x;\n for (const {target} of node.sourceLinks) {\n next.add(target);\n }\n }\n if (++x > n) throw new Error(\"circular link\");\n current = next;\n next = new Set;\n }\n }\n\n function computeNodeHeights({nodes}) {\n const n = nodes.length;\n let current = new Set(nodes);\n let next = new Set;\n let x = 0;\n while (current.size) {\n for (const node of current) {\n node.height = x;\n for (const {source} of node.targetLinks) {\n next.add(source);\n }\n }\n if (++x > n) throw new Error(\"circular link\");\n current = next;\n next = new Set;\n }\n }\n\n function computeNodeLayers({nodes}) {\n const x = max(nodes, d => d.depth) + 1;\n const kx = (x1 - x0 - dx) / (x - 1);\n const columns = new Array(x);\n for (const node of nodes) {\n const i = Math.max(0, Math.min(x - 1, Math.floor(align.call(null, node, x))));\n node.layer = i;\n node.x0 = x0 + i * kx;\n node.x1 = node.x0 + dx;\n if (columns[i]) columns[i].push(node);\n else columns[i] = [node];\n }\n if (sort) for (const column of columns) {\n column.sort(sort);\n }\n return columns;\n }\n\n function initializeNodeBreadths(columns) {\n const ky = min(columns, c => (y1 - y0 - (c.length - 1) * py) / sum(c, value));\n for (const nodes of columns) {\n let y = y0;\n for (const node of nodes) {\n node.y0 = y;\n node.y1 = y + node.value * ky;\n y = node.y1 + py;\n for (const link of node.sourceLinks) {\n link.width = link.value * ky;\n }\n }\n y = (y1 - y + py) / (nodes.length + 1);\n for (let i = 0; i < nodes.length; ++i) {\n const node = nodes[i];\n node.y0 += y * (i + 1);\n node.y1 += y * (i + 1);\n }\n reorderLinks(nodes);\n }\n }\n\n function computeNodeBreadths(graph) {\n const columns = computeNodeLayers(graph);\n py = Math.min(dy, (y1 - y0) / (max(columns, c => c.length) - 1));\n initializeNodeBreadths(columns);\n for (let i = 0; i < iterations; ++i) {\n const alpha = Math.pow(0.99, i);\n const beta = Math.max(1 - alpha, (i + 1) / iterations);\n relaxRightToLeft(columns, alpha, beta);\n relaxLeftToRight(columns, alpha, beta);\n }\n }\n\n // Reposition each node based on its incoming (target) links.\n function relaxLeftToRight(columns, alpha, beta) {\n for (let i = 1, n = columns.length; i < n; ++i) {\n const column = columns[i];\n for (const target of column) {\n let y = 0;\n let w = 0;\n for (const {source, value} of target.targetLinks) {\n let v = value * (target.layer - source.layer);\n y += targetTop(source, target) * v;\n w += v;\n }\n if (!(w > 0)) continue;\n let dy = (y / w - target.y0) * alpha;\n target.y0 += dy;\n target.y1 += dy;\n reorderNodeLinks(target);\n }\n if (sort === undefined) column.sort(ascendingBreadth);\n resolveCollisions(column, beta);\n }\n }\n\n // Reposition each node based on its outgoing (source) links.\n function relaxRightToLeft(columns, alpha, beta) {\n for (let n = columns.length, i = n - 2; i >= 0; --i) {\n const column = columns[i];\n for (const source of column) {\n let y = 0;\n let w = 0;\n for (const {target, value} of source.sourceLinks) {\n let v = value * (target.layer - source.layer);\n y += sourceTop(source, target) * v;\n w += v;\n }\n if (!(w > 0)) continue;\n let dy = (y / w - source.y0) * alpha;\n source.y0 += dy;\n source.y1 += dy;\n reorderNodeLinks(source);\n }\n if (sort === undefined) column.sort(ascendingBreadth);\n resolveCollisions(column, beta);\n }\n }\n\n function resolveCollisions(nodes, alpha) {\n const i = nodes.length >> 1;\n const subject = nodes[i];\n resolveCollisionsBottomToTop(nodes, subject.y0 - py, i - 1, alpha);\n resolveCollisionsTopToBottom(nodes, subject.y1 + py, i + 1, alpha);\n resolveCollisionsBottomToTop(nodes, y1, nodes.length - 1, alpha);\n resolveCollisionsTopToBottom(nodes, y0, 0, alpha);\n }\n\n // Push any overlapping nodes down.\n function resolveCollisionsTopToBottom(nodes, y, i, alpha) {\n for (; i < nodes.length; ++i) {\n const node = nodes[i];\n const dy = (y - node.y0) * alpha;\n if (dy > 1e-6) node.y0 += dy, node.y1 += dy;\n y = node.y1 + py;\n }\n }\n\n // Push any overlapping nodes up.\n function resolveCollisionsBottomToTop(nodes, y, i, alpha) {\n for (; i >= 0; --i) {\n const node = nodes[i];\n const dy = (node.y1 - y) * alpha;\n if (dy > 1e-6) node.y0 -= dy, node.y1 -= dy;\n y = node.y0 - py;\n }\n }\n\n function reorderNodeLinks({sourceLinks, targetLinks}) {\n if (linkSort === undefined) {\n for (const {source: {sourceLinks}} of targetLinks) {\n sourceLinks.sort(ascendingTargetBreadth);\n }\n for (const {target: {targetLinks}} of sourceLinks) {\n targetLinks.sort(ascendingSourceBreadth);\n }\n }\n }\n\n function reorderLinks(nodes) {\n if (linkSort === undefined) {\n for (const {sourceLinks, targetLinks} of nodes) {\n sourceLinks.sort(ascendingTargetBreadth);\n targetLinks.sort(ascendingSourceBreadth);\n }\n }\n }\n\n // Returns the target.y0 that would produce an ideal link from source to target.\n function targetTop(source, target) {\n let y = source.y0 - (source.sourceLinks.length - 1) * py / 2;\n for (const {target: node, width} of source.sourceLinks) {\n if (node === target) break;\n y += width + py;\n }\n for (const {source: node, width} of target.targetLinks) {\n if (node === source) break;\n y -= width;\n }\n return y;\n }\n\n // Returns the source.y0 that would produce an ideal link from source to target.\n function sourceTop(source, target) {\n let y = target.y0 - (target.targetLinks.length - 1) * py / 2;\n for (const {source: node, width} of target.targetLinks) {\n if (node === source) break;\n y += width + py;\n }\n for (const {target: node, width} of source.sourceLinks) {\n if (node === target) break;\n y -= width;\n }\n return y;\n }\n\n return sankey;\n}\n","var pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n },\n lineTo: function(x, y) {\n this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var 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 the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += \"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._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var 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._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n }\n\n this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n var 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 the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += \"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._ += \"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._ += \"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._ += \"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: function(x, y, w, h) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n },\n toString: function() {\n return this._;\n }\n};\n\nexport default path;\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","export var slice = Array.prototype.slice;\n","import {path} from \"d3-path\";\nimport {slice} from \"../array.js\";\nimport constant from \"../constant.js\";\nimport {x as pointX, y as pointY} from \"../point.js\";\nimport pointRadial from \"../pointRadial.js\";\n\nfunction linkSource(d) {\n return d.source;\n}\n\nfunction linkTarget(d) {\n return d.target;\n}\n\nfunction link(curve) {\n var source = linkSource,\n target = linkTarget,\n x = pointX,\n y = pointY,\n context = null;\n\n function link() {\n var buffer, argv = slice.call(arguments), s = source.apply(this, argv), t = target.apply(this, argv);\n if (!context) context = buffer = path();\n curve(context, +x.apply(this, (argv[0] = s, argv)), +y.apply(this, argv), +x.apply(this, (argv[0] = t, argv)), +y.apply(this, argv));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n link.source = function(_) {\n return arguments.length ? (source = _, link) : source;\n };\n\n link.target = function(_) {\n return arguments.length ? (target = _, link) : target;\n };\n\n link.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), link) : x;\n };\n\n link.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), link) : y;\n };\n\n link.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), link) : context;\n };\n\n return link;\n}\n\nfunction curveHorizontal(context, x0, y0, x1, y1) {\n context.moveTo(x0, y0);\n context.bezierCurveTo(x0 = (x0 + x1) / 2, y0, x0, y1, x1, y1);\n}\n\nfunction curveVertical(context, x0, y0, x1, y1) {\n context.moveTo(x0, y0);\n context.bezierCurveTo(x0, y0 = (y0 + y1) / 2, x1, y0, x1, y1);\n}\n\nfunction curveRadial(context, x0, y0, x1, y1) {\n var p0 = pointRadial(x0, y0),\n p1 = pointRadial(x0, y0 = (y0 + y1) / 2),\n p2 = pointRadial(x1, y0),\n p3 = pointRadial(x1, y1);\n context.moveTo(p0[0], p0[1]);\n context.bezierCurveTo(p1[0], p1[1], p2[0], p2[1], p3[0], p3[1]);\n}\n\nexport function linkHorizontal() {\n return link(curveHorizontal);\n}\n\nexport function linkVertical() {\n return link(curveVertical);\n}\n\nexport function linkRadial() {\n var l = link(curveRadial);\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n return l;\n}\n","import {linkHorizontal} from \"d3-shape\";\n\nfunction horizontalSource(d) {\n return [d.source.x1, d.y0];\n}\n\nfunction horizontalTarget(d) {\n return [d.target.x0, d.y1];\n}\n\nexport default function() {\n return linkHorizontal()\n .source(horizontalSource)\n .target(horizontalTarget);\n}\n","import { select } from 'd3'\nimport {\n\tsankey as d3Sankey,\n\tsankeyLinkHorizontal,\n\tsankeyLeft,\n\tsankeyRight,\n\tsankeyJustify\n} from 'd3-sankey'\nimport { debounce } from 'lodash-es'\nimport { getProperty, getTransformOffsets } from '@/tools'\nimport { alluvial as alluvialConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { Events, ColorClassNameTypes, RenderTypes, Alignments } from '@/interfaces/enums'\n\n// BUG: Typing is not working for this.services.domUtils from the base class Component.\n// DOMUtils is already imported directly to this module so why bother using this.services.domUtils?\n\nexport class Alluvial extends Component {\n\ttype = 'alluvial'\n\trenderType = RenderTypes.SVG\n\n\tprivate graph: any\n\tgradient_id = 'gradient-id-' + Math.floor(Math.random() * 99999999999)\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\t// svg and container widths\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true })\n\t\tsvg.html('')\n\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\t// Because of a Firefox bug with regards to sizing & d3 packs,\n\t\t// rather than checking if height or width aren't 0,\n\t\t// we have to make sure they're not smaller than 1\n\t\tif (width < 1 || height < 1) {\n\t\t\treturn\n\t\t}\n\t\tconst options = this.model.getOptions()\n\t\tconst data = this.model.getDisplayData()\n\n\t\t// Is gradient enabled or not\n\t\tconst isGradientAllowed: boolean = getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'color',\n\t\t\t'gradient',\n\t\t\t'enabled'\n\t\t)\n\n\t\t// Set the custom node padding if provided\n\t\tlet nodePadding = alluvialConfigs.minNodePadding\n\t\tif (options.alluvial.nodePadding > alluvialConfigs.minNodePadding) {\n\t\t\tnodePadding = options.alluvial.nodePadding\n\t\t}\n\n\t\tconst alignment = getProperty(options, 'alluvial', 'nodeAlignment')\n\n\t\tlet nodeAlignment = sankeyJustify\n\n\t\tif (alignment === Alignments.LEFT) {\n\t\t\tnodeAlignment = sankeyLeft\n\t\t} else if (alignment === Alignments.RIGHT) {\n\t\t\tnodeAlignment = sankeyRight\n\t\t}\n\n\t\tconst sankey = d3Sankey()\n\t\t\t.nodeId((node: any) => node.name)\n\t\t\t.nodeWidth(alluvialConfigs.nodeWidth)\n\t\t\t// Distance nodes are apart from each other\n\t\t\t.nodePadding(nodePadding)\n\t\t\t// Alignment of nodes within chart\n\t\t\t.nodeAlign(nodeAlignment)\n\t\t\t// Size of the chart and its padding\n\t\t\t// Chart starts at 2 and ends at width - 2 so the outer nodes can expand from center\n\t\t\t// Chart starts from 30 so node categories can be displayed\n\t\t\t.extent([\n\t\t\t\t[2, 30],\n\t\t\t\t[width - 2, height]\n\t\t\t])\n\n\t\t// Construct a graph with the provided user data\n\t\t// Data must be deep cloned to ensure user passed data isn't deleted when themes change\n\t\tthis.graph = sankey({\n\t\t\tnodes: options.alluvial.nodes.map((d: any) => Object.assign({}, d)),\n\t\t\tlinks: data.map((d: any) => Object.assign({}, d))\n\t\t})\n\n\t\t// Filter out unused nodes so they are not rendered\n\t\tthis.graph.nodes = this.graph.nodes.filter((node: any) => node.value !== 0)\n\n\t\t// Determine the category name placement x position\n\t\tconst nodeCoordinates: any = {}\n\t\tthis.graph.nodes.forEach((element: any) => {\n\t\t\tconst point = element.x0\n\n\t\t\t// Only 1 category per x-value\n\t\t\tif (element.category) {\n\t\t\t\tnodeCoordinates[point] = element?.category\n\t\t\t}\n\t\t})\n\n\t\t// Add node category text\n\t\tconst alluvialCategory = svg\n\t\t\t.append('g')\n\t\t\t.classed('header-arrows', true)\n\t\t\t.selectAll('g')\n\t\t\t.data(Object.keys(nodeCoordinates))\n\t\t\t.join('g')\n\t\t\t.attr('transform', (d: any) => {\n\t\t\t\treturn `translate(${d}, 0)`\n\t\t\t})\n\n\t\t// Add the category text\n\t\talluvialCategory\n\t\t\t.append('text')\n\t\t\t.attr('id', (_: any, i: number) =>\n\t\t\t\tthis.services.domUtils.generateElementIDString(`alluvial-category-${i}`)\n\t\t\t)\n\t\t\t.style('font-size', '14px')\n\t\t\t.text((d: any) => {\n\t\t\t\tif (nodeCoordinates[d]) {\n\t\t\t\t\treturn nodeCoordinates[d]\n\t\t\t\t}\n\t\t\t\treturn ''\n\t\t\t})\n\t\t\t.attr('y', 20)\n\t\t\t.attr('x', (d: any, i: number) => {\n\t\t\t\tconst elementID = this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`alluvial-category-${i}`\n\t\t\t\t) as string\n\n\t\t\t\tconst { width: textWidth } = DOMUtils.getSVGElementSize(select(`text#${elementID}`), {\n\t\t\t\t\tuseBBox: true\n\t\t\t\t})\n\n\t\t\t\t// Make the text on the left on node group (except first column)\n\t\t\t\tlet x = 0\n\t\t\t\tif (d + x >= textWidth) {\n\t\t\t\t\tx = -textWidth + 4\n\t\t\t\t}\n\t\t\t\treturn x\n\t\t\t})\n\n\t\t// Draws the links (Waves)\n\t\tconst links = svg.append('g').attr('fill', 'none').selectAll('g').data(this.graph.links)\n\n\t\t// Exit so we can have multiple appends in group\n\t\tlinks.exit().remove()\n\n\t\t// Add gradient if requsted\n\t\tif (isGradientAllowed) {\n\t\t\tconst scale = getProperty(this.getOptions(), 'color', 'scale')\n\n\t\t\tif (scale) {\n\t\t\t\tlinks\n\t\t\t\t\t.enter()\n\t\t\t\t\t.append('linearGradient')\n\t\t\t\t\t.attr('id', (d: any) => `${this.gradient_id}-link-${d.index}`)\n\t\t\t\t\t.attr('gradientUnits', 'userSpaceOnUse')\n\t\t\t\t\t.call((gradient: any) =>\n\t\t\t\t\t\tgradient\n\t\t\t\t\t\t\t.append('stop')\n\t\t\t\t\t\t\t.attr('offset', '0%')\n\t\t\t\t\t\t\t.attr('stop-color', (d: any) => {\n\t\t\t\t\t\t\t\treturn scale[d.source.name]\n\t\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.call((gradient: any) =>\n\t\t\t\t\t\tgradient\n\t\t\t\t\t\t\t.append('stop')\n\t\t\t\t\t\t\t.attr('offset', '100%')\n\t\t\t\t\t\t\t.attr('stop-color', (d: any) => {\n\t\t\t\t\t\t\t\treturn scale[d.target.name]\n\t\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t}\n\t\t\t// Exit so path can be appended to the group\n\t\t\tlinks.exit().remove()\n\t\t}\n\n\t\tlinks\n\t\t\t.enter()\n\t\t\t.append('path')\n\t\t\t.classed('link', true)\n\t\t\t.attr('d', sankeyLinkHorizontal())\n\t\t\t.attr('id', (d: any) =>\n\t\t\t\tthis.services.domUtils.generateElementIDString(`alluvial-line-${d.index}`)\n\t\t\t)\n\t\t\t.attr('class', (d: any) => {\n\t\t\t\t// Use a single color for the lines\n\t\t\t\tif (options.alluvial.monochrome) {\n\t\t\t\t\treturn this.model.getColorClassName({\n\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\t\tdataGroupName: 0,\n\t\t\t\t\t\toriginalClassName: 'link'\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\treturn this.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\tdataGroupName: d.source.index,\n\t\t\t\t\toriginalClassName: 'link'\n\t\t\t\t})\n\t\t\t})\n\t\t\t.style('stroke', (d: any) => {\n\t\t\t\tif (isGradientAllowed) {\n\t\t\t\t\treturn `url(#${this.gradient_id}-link-${d.index})`\n\t\t\t\t}\n\n\t\t\t\treturn this.model.getFillColor(d.source.name)\n\t\t\t})\n\t\t\t.attr('stroke-width', (d: any) => Math.max(1, d.width))\n\t\t\t.style('stroke-opacity', alluvialConfigs.opacity.default)\n\t\t\t.attr(\n\t\t\t\t'aria-label',\n\t\t\t\t(d: any) =>\n\t\t\t\t\t`${d.source.name} → ${d.target.name} (${d.value}${\n\t\t\t\t\t\toptions.alluvial.units ? ' ' + options.alluvial.units : ''\n\t\t\t\t\t})`\n\t\t\t)\n\n\t\t// Creating the groups\n\t\tconst node = svg\n\t\t\t.append('g')\n\t\t\t.selectAll('g')\n\t\t\t.data(this.graph.nodes)\n\t\t\t.enter()\n\t\t\t.append('g')\n\t\t\t.attr('id', (d: any) =>\n\t\t\t\tthis.services.domUtils.generateElementIDString(`alluvial-node-${d.index}`)\n\t\t\t)\n\t\t\t.classed('node-group', true)\n\t\t\t.attr('transform', (d: any) => `translate(${d.x0}, ${d.y0})`)\n\n\t\t// Creating the nodes\n\t\tnode\n\t\t\t.append('rect')\n\t\t\t.classed('node', true)\n\t\t\t.attr('height', (d: any) => d.y1 - d.y0)\n\t\t\t.attr('width', (d: any) => d.x1 - d.x0)\n\t\t\t.attr('fill', 'black')\n\n\t\t// Group to hold the text & rectangle background\n\t\tconst textNode = node\n\t\t\t.append('g')\n\t\t\t.attr('id', (d: any) =>\n\t\t\t\tthis.services.domUtils.generateElementIDString(`alluvial-node-title-${d.index}`)\n\t\t\t)\n\n\t\t// Node title - text\n\t\ttextNode\n\t\t\t.append('text')\n\t\t\t.attr('id', (d: any) =>\n\t\t\t\tthis.services.domUtils.generateElementIDString(`alluvial-node-text-${d.index}`)\n\t\t\t)\n\t\t\t.attr('class', 'node-text')\n\t\t\t.style('font-size', '12px')\n\t\t\t.attr('text-anchor', 'start')\n\t\t\t.attr('fill', 'white')\n\t\t\t// Padding to text\n\t\t\t.attr('x', 4)\n\t\t\t// shift 13 pixels down to fit background container\n\t\t\t.attr('dy', 13)\n\t\t\t.text((d: any) => {\n\t\t\t\treturn `${d.name} (${d.value})`\n\t\t\t})\n\t\t\t.attr('aria-label', (d: any) => {\n\t\t\t\treturn `${d.name} (${d.value})`\n\t\t\t})\n\n\t\t// Text background\n\t\ttextNode\n\t\t\t.append('rect')\n\t\t\t.classed('node-text-bg', true)\n\t\t\t.attr('width', (_: any, i: number) => {\n\t\t\t\tconst elementID = this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`alluvial-node-text-${i}`\n\t\t\t\t) as string\n\n\t\t\t\t// Determine rectangle width based on text width\n\t\t\t\tconst { width: textWidth } = DOMUtils.getSVGElementSize(select(`text#${elementID}`), {\n\t\t\t\t\tuseBBox: true\n\t\t\t\t})\n\n\t\t\t\treturn textWidth + 8\n\t\t\t})\n\t\t\t.attr('height', 18)\n\t\t\t.attr('stroke-width', 2)\n\t\t\t.lower()\n\n\t\t// Position group based on text width\n\t\ttextNode.attr('transform', (d: any, i: number) => {\n\t\t\tconst elementID = this.services.domUtils.generateElementIDString(\n\t\t\t\t`alluvial-node-text-${i}`\n\t\t\t) as string\n\n\t\t\tconst { width: textWidth } = DOMUtils.getSVGElementSize(select(`text#${elementID}`), {\n\t\t\t\tuseBBox: true\n\t\t\t})\n\n\t\t\t// Subtracting 9 since text background is 18 to center\n\t\t\tconst y = (d.y1 - d.y0) / 2 - 9\n\t\t\t// Node width\n\t\t\tlet x = d.x1 - d.x0\n\n\t\t\t// Display bars on the right instead of left of the node\n\t\t\tif (d.x1 >= textWidth) {\n\t\t\t\t// 16 = node width (4) + text container padding (8) + distance between node and text container (4)\n\t\t\t\tx = x - (textWidth + 16)\n\t\t\t} else {\n\t\t\t\t// Add padding to text containers\n\t\t\t\tx += 4\n\t\t\t}\n\n\t\t\treturn `translate(${x}, ${y})`\n\t\t})\n\n\t\tthis.addLineEventListener()\n\t\tthis.addNodeEventListener()\n\t}\n\n\taddLineEventListener() {\n\t\tconst options = this.getOptions()\n\t\tconst self = this\n\n\t\t// Set delay to counter flashy behaviour\n\t\tconst debouncedLineHighlight = debounce((link, event = 'mouseover') => {\n\t\t\tconst allLinks = self.parent\n\t\t\t\t.selectAll('path.link')\n\t\t\t\t.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'alluvial-links-mouse-highlight'\n\t\t\t\t\t})\n\t\t\t\t)\n\n\t\t\tif (event === 'mouseout') {\n\t\t\t\tselect(link).lower()\n\t\t\t\tallLinks.style('stroke-opacity', alluvialConfigs.opacity.default)\n\t\t\t} else {\n\t\t\t\tallLinks.style('stroke-opacity', function () {\n\t\t\t\t\t// highlight and raise if link is this\n\t\t\t\t\tif (link === this) {\n\t\t\t\t\t\tselect(this).raise()\n\t\t\t\t\t\treturn alluvialConfigs.opacity.selected\n\t\t\t\t\t}\n\n\t\t\t\t\treturn alluvialConfigs.opacity.unfocus\n\t\t\t\t})\n\t\t\t}\n\t\t}, 33)\n\n\t\tthis.parent\n\t\t\t.selectAll('path.link')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\tdebouncedLineHighlight(this, 'mouseover')\n\t\t\t\thoveredElement.classed('link-hovered', true)\n\n\t\t\t\tconst strokeColor = getComputedStyle(this as Element).getPropertyValue('stroke')\n\n\t\t\t\t// Dispatch mouse over event\n\t\t\t\tself.services.events.dispatchEvent(Events.Alluvial.LINE_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Dispatch tooltip show event\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: datum.target.name,\n\t\t\t\t\t\t\tvalue: datum.value + (options.alluvial.units ? ` ${options.alluvial.units}` : ''),\n\t\t\t\t\t\t\tcolor: strokeColor,\n\t\t\t\t\t\t\tlabelIcon: self.getRightArrowIcon()\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse move event\n\t\t\t\tself.services.events.dispatchEvent(Events.Alluvial.LINE_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t\t// Dispatch tooltip move event\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse click event\n\t\t\t\tself.services.events.dispatchEvent(Events.Alluvial.LINE_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\tdebouncedLineHighlight(this, 'mouseout')\n\t\t\t\thoveredElement.classed('link-hovered', false)\n\n\t\t\t\t// Dispatch mouse out event\n\t\t\t\tself.services.events.dispatchEvent(Events.Alluvial.LINE_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Dispatch hide tooltip event\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\taddNodeEventListener() {\n\t\tconst self = this\n\n\t\t// Set delay to counter flashy behaviour\n\t\tconst debouncedLineHighlight = debounce((links = [], event = 'mouseover') => {\n\t\t\tif (event === 'mouseout' || links.length === 0) {\n\t\t\t\t// set all links to default opacity & corret link order\n\t\t\t\tself.parent\n\t\t\t\t\t.selectAll('path.link')\n\t\t\t\t\t.classed('link-hovered', false)\n\t\t\t\t\t.data(this.graph.links, (d: any) => d.index)\n\t\t\t\t\t.order()\n\t\t\t\t\t.style('stroke-opacity', alluvialConfigs.opacity.default)\n\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Highlight all nodes\n\t\t\tconst allLinks = self.parent\n\t\t\t\t.selectAll('path.link')\n\t\t\t\t.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'alluvial-link-mouse-highlight'\n\t\t\t\t\t})\n\t\t\t\t)\n\n\t\t\tallLinks.style('stroke-opacity', function (d: any) {\n\t\t\t\t// Raise the links & increase stroke-opacity to selected\n\t\t\t\tif (links.some((element: any) => element === d.index)) {\n\t\t\t\t\tselect(this).classed('link-hovered', true).raise()\n\t\t\t\t\treturn alluvialConfigs.opacity.selected\n\t\t\t\t}\n\n\t\t\t\treturn alluvialConfigs.opacity.unfocus\n\t\t\t})\n\t\t}, 66)\n\n\t\tself.parent\n\t\t\t.selectAll('.node-group')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Highlight all links that pass through node\n\t\t\t\tconst paths: any[] = []\n\n\t\t\t\t// Outgoing links\n\t\t\t\tself.traverse({ link: 'sourceLinks', node: 'target' }, datum, paths)\n\n\t\t\t\t//Incoming links\n\t\t\t\tself.traverse({ link: 'targetLinks', node: 'source' }, datum, paths)\n\n\t\t\t\t// Highlight all linked lines in the graph data structure\n\t\t\t\tif (paths.length) {\n\t\t\t\t\t// Get transformation value of node\n\t\t\t\t\tconst nodeMatrix = getTransformOffsets(hoveredElement.attr('transform'))\n\n\t\t\t\t\t// Move node to the left by 2 to grow node from the center\n\t\t\t\t\thoveredElement.attr('transform', `translate(${nodeMatrix.x - 2}, ${nodeMatrix.y})`)\n\n\t\t\t\t\thoveredElement.classed('node-hovered', true).selectAll('rect.node').attr('width', 8)\n\n\t\t\t\t\t// Translate first column text container to the\n\t\t\t\t\t// right so it doesn't clash with expanding node\n\t\t\t\t\tif (datum.x0 - 2 === 0) {\n\t\t\t\t\t\tconst elementID = self.services.domUtils.generateElementIDString(\n\t\t\t\t\t\t\t`alluvial-node-title-${datum.index}`\n\t\t\t\t\t\t)\n\n\t\t\t\t\t\tconst titleContainer = self.parent.select(`g#${elementID}`)\n\t\t\t\t\t\tconst titleMatrix = getTransformOffsets(titleContainer.attr('transform'))\n\n\t\t\t\t\t\ttitleContainer.attr('transform', `translate(${titleMatrix.x + 4},${titleMatrix.y})`)\n\t\t\t\t\t}\n\n\t\t\t\t\tconst elementID = self.services.domUtils.generateElementIDString(\n\t\t\t\t\t\t`alluvial-node-text-${datum.index}`\n\t\t\t\t\t)\n\n\t\t\t\t\tself.parent.select(`text#${elementID}`).style('font-weight', 'bold')\n\n\t\t\t\t\tdebouncedLineHighlight(paths, 'mouseover')\n\n\t\t\t\t\t// Dispatch mouse over event\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Alluvial.NODE_MOUSEOVER, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\t\tdatum\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse move event\n\t\t\t\tself.services.events.dispatchEvent(Events.Alluvial.NODE_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Dispatch tooltip move event\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse click event\n\t\t\t\tself.services.events.dispatchEvent(Events.Alluvial.NODE_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Set the node position to initial state (unexpanded)\n\t\t\t\tconst nodeMatrix = getTransformOffsets(hoveredElement.attr('transform'))\n\n\t\t\t\thoveredElement\n\t\t\t\t\t.classed('node-hovered', false)\n\t\t\t\t\t.attr('transform', `translate(${nodeMatrix.x + 2}, ${nodeMatrix.y})`)\n\t\t\t\t\t.select('rect.node')\n\t\t\t\t\t.attr('width', alluvialConfigs.nodeWidth)\n\n\t\t\t\t// Translate text container back to initial state\n\t\t\t\tif (datum.x0 - 2 === 0) {\n\t\t\t\t\tconst elementID = self.services.domUtils.generateElementIDString(\n\t\t\t\t\t\t`alluvial-node-title-${datum.index}`\n\t\t\t\t\t)\n\n\t\t\t\t\tconst titleContainer = self.parent.select(`g#${elementID}`)\n\t\t\t\t\tconst titleMatrix = getTransformOffsets(titleContainer.attr('transform'))\n\n\t\t\t\t\ttitleContainer.attr('transform', `translate(${titleMatrix.x - 4},${titleMatrix.y})`)\n\t\t\t\t}\n\n\t\t\t\tconst elementID = self.services.domUtils.generateElementIDString(\n\t\t\t\t\t`alluvial-node-text-${datum.index}`\n\t\t\t\t)\n\n\t\t\t\tself.parent.select(`text#${elementID}`).style('font-weight', 'normal')\n\n\t\t\t\tdebouncedLineHighlight([], 'mouseout')\n\n\t\t\t\t// Dispatch mouse out event\n\t\t\t\tself.services.events.dispatchEvent(Events.Alluvial.NODE_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Dispatch hide tooltip event\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\t// Traverse graph and get all connected links to node\n\tprivate traverse(\n\t\tdirection: { link: 'sourceLinks'; node: 'target' } | { link: 'targetLinks'; node: 'source' },\n\t\tnode: any,\n\t\tvisited: any[] = []\n\t) {\n\t\tconst links = node[direction.link].map((element: any) => {\n\t\t\tvisited.push(element.index)\n\t\t\treturn element[direction.node]\n\t\t})\n\n\t\t// Retrieve the child nodes\n\t\tlinks.forEach((element: any) => this.traverse(direction, element, visited))\n\t}\n\n\tgetRightArrowIcon() {\n\t\treturn `\n\t\t<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"arrow-right\" width=\"32\" height=\"32\" viewBox=\"0 0 32 32\">\n\t\t\t<polygon points=\"18 6 16.57 7.393 24.15 15 4 15 4 17 24.15 17 16.57 24.573 18 26 28 16 18 6\"/>\n\t\t\t<rect width=\"32\" height=\"32\"/>\n\t\t</svg>`\n\t}\n\n\t// Remove event listeners\n\tdestroy() {\n\t\tthis.parent\n\t\t\t.selectAll('path.line,.node-group')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('click', null)\n\t\t\t.on('mouseout', null)\n\t}\n}\n","import { Chart } from '@/chart'\nimport { AlluvialChartModel } from '@/model/alluvial'\nimport { options } from '@/configuration'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { AlluvialChartOptions } from '@/interfaces/charts'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport { Alluvial } from '@/components/graphs/alluvial'\nimport type { Component } from '@/components/component'\n\nexport class AlluvialChart extends Chart {\n\tmodel = new AlluvialChartModel(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<AlluvialChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.alluvialChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [new Alluvial(this.model, this.services)]\n\n\t\tconst components: Component[] = this.getChartComponents(graphFrameComponents, {\n\t\t\texcludeLegend: true\n\t\t})\n\t\treturn components\n\t}\n}\n","import { brushX, pointer, scaleTime } from 'd3'\nimport { Component } from '@/components/component'\nimport { RenderTypes, ScaleTypes } from '@/interfaces/enums'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { Selection } from 'd3'\n\n// This class is used for handle brush events in chart\nexport class ChartBrush extends Component {\n\tstatic DASH_LENGTH = 4\n\n\ttype = 'grid-brush'\n\trenderType = RenderTypes.SVG\n\n\tselectionSelector = 'rect.selection' // needs to match the class name in d3.brush\n\n\tfrontSelectionSelector = 'rect.frontSelection' // needs to match the class name in _grid-brush.scss\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\tconst svg = this.parent\n\n\t\t// use this area to display selection above all graphs\n\t\tconst frontSelectionArea = this.getComponentContainer()\n\t\tif (!svg) throw new Error('SVG was not defined')\n\t\tconst backdrop = DOMUtils.appendOrSelect(\n\t\t\tsvg as Selection<SVGGraphicsElement, any, HTMLElement, any>,\n\t\t\t'svg.chart-grid-backdrop'\n\t\t)\n\t\t// use this area to handle d3 brush events\n\t\tconst brushArea = DOMUtils.appendOrSelect(backdrop, `g.${this.type}`)\n\n\t\t// set an id for rect.selection to be referred\n\t\tconst d3Selection = DOMUtils.appendOrSelect(brushArea, this.selectionSelector)\n\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(backdrop, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tconst { cartesianScales } = this.services\n\t\tconst mainXScaleType = cartesianScales.getMainXScaleType()\n\t\tconst mainXScale = cartesianScales.getMainXScale()\n\t\tconst [xScaleStart] = mainXScale.range()\n\t\tfrontSelectionArea.attr('transform', `translate(${xScaleStart},0)`)\n\t\tconst frontSelection = DOMUtils.appendOrSelect(frontSelectionArea, this.frontSelectionSelector)\n\n\t\tif (mainXScale && mainXScaleType === ScaleTypes.TIME) {\n\t\t\t// get current zoomDomain\n\t\t\tlet zoomDomain = this.model.get('zoomDomain')\n\t\t\tif (zoomDomain === undefined) {\n\t\t\t\t// default to full range with extended domain\n\t\t\t\tzoomDomain = this.services.zoom.getDefaultZoomBarDomain()\n\t\t\t\tif (zoomDomain) {\n\t\t\t\t\tthis.model.set({ zoomDomain: zoomDomain }, { animate: false })\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst updateSelectionDash = (selection: any) => {\n\t\t\t\t// set end drag point to dash\n\t\t\t\tconst selectionWidth = selection[1] - selection[0]\n\t\t\t\tlet dashArray = '0,' + selectionWidth.toString() // top (invisible)\n\n\t\t\t\t// right\n\t\t\t\tconst dashCount = Math.floor(height / ChartBrush.DASH_LENGTH)\n\t\t\t\tconst totalRightDash = dashCount * ChartBrush.DASH_LENGTH\n\t\t\t\tfor (let i = 0; i < dashCount; i++) {\n\t\t\t\t\tdashArray += ',' + ChartBrush.DASH_LENGTH // for each full length dash\n\t\t\t\t}\n\t\t\t\tdashArray += ',' + (height - totalRightDash) // for rest of the right height\n\t\t\t\t// if dash count is even, one more \",0\" is needed to make total right dash pattern even\n\t\t\t\tif (dashCount % 2 === 1) {\n\t\t\t\t\tdashArray += ',0'\n\t\t\t\t}\n\t\t\t\tdashArray += ',' + selectionWidth.toString() // bottom (invisible)\n\t\t\t\tdashArray += ',' + height.toString() // left\n\t\t\t\tfrontSelection.attr('stroke-dasharray', dashArray)\n\t\t\t}\n\n\t\t\tconst brushEventHandler = (event: any) => {\n\t\t\t\t// selection range: [0, width]\n\t\t\t\tconst selection = event.selection\n\t\t\t\tif (selection === null || selection[0] === selection[1]) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// copy the d3 selection attrs to front selection element\n\t\t\t\tfrontSelection\n\t\t\t\t\t.attr('x', parseFloat(d3Selection.attr('x')) + parseFloat(backdrop.attr('x')))\n\t\t\t\t\t.attr('y', d3Selection.attr('y'))\n\t\t\t\t\t.attr('width', d3Selection.attr('width'))\n\t\t\t\t\t.attr('height', d3Selection.attr('height'))\n\t\t\t\t\t.style('cursor', 'pointer')\n\t\t\t\t\t.style('display', null)\n\n\t\t\t\tupdateSelectionDash(selection)\n\t\t\t}\n\n\t\t\t// assume max range is [0, width]\n\t\t\tconst updateZoomDomain = (startPoint: any, endPoint: any) => {\n\t\t\t\t// create xScale based on current zoomDomain\n\t\t\t\tconst xScale = scaleTime().range([0, width]).domain(zoomDomain)\n\n\t\t\t\tlet newDomain = [xScale.invert(startPoint), xScale.invert(endPoint)]\n\t\t\t\t// if selected start time and end time are the same\n\t\t\t\t// reset to default full range\n\t\t\t\tif (newDomain[0].valueOf() === newDomain[1].valueOf()) {\n\t\t\t\t\t// same as d3 behavior and zoom bar behavior: set to default full range\n\t\t\t\t\tnewDomain = this.services.zoom.getDefaultZoomBarDomain()\n\t\t\t\t}\n\n\t\t\t\t// only if zoomDomain needs update\n\t\t\t\tif (\n\t\t\t\t\tzoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\t\t\tzoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t\t\t) {\n\t\t\t\t\tthis.services.zoom.handleDomainChange(newDomain)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet brush: any\n\n\t\t\tconst brushed = (event: any) => {\n\t\t\t\t// max selection range: [0, width]\n\t\t\t\tconst selection = event.selection\n\n\t\t\t\tif (selection !== null) {\n\t\t\t\t\t// updateZoomDomain assumes max range is [0, width]\n\t\t\t\t\tupdateZoomDomain(selection[0], selection[1])\n\n\t\t\t\t\t// clear brush selection\n\t\t\t\t\tbrushArea.call(brush.move, null)\n\t\t\t\t\t// hide frontSelection\n\t\t\t\t\tfrontSelection.style('display', 'none')\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (height != 0 && width != 0) {\n\t\t\t\t// leave some space to display selection strokes beside axes\n\t\t\t\tbrush = brushX()\n\t\t\t\t\t.extent([\n\t\t\t\t\t\t[0, 0],\n\t\t\t\t\t\t[width - 1, height]\n\t\t\t\t\t])\n\t\t\t\t\t.on('start brush end', brushEventHandler)\n\t\t\t\t\t.on('end.brushed', brushed)\n\n\t\t\t\tbrushArea.call(brush)\n\t\t\t}\n\n\t\t\tconst zoomRatio: number = this.services.zoom.getZoomRatio()\n\t\t\tbackdrop.on('click', function (event: MouseEvent) {\n\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\tconst holder = this.services.domUtils.getHolder()\n\n\t\t\t\t\t// clickedX range: [0, width]\n\t\t\t\t\tconst clickedX = pointer(brushArea.node(), holder)[0]\n\n\t\t\t\t\tlet leftPoint = clickedX - (width * zoomRatio) / 2\n\t\t\t\t\tif (leftPoint < 0) {\n\t\t\t\t\t\tleftPoint = 0\n\t\t\t\t\t}\n\t\t\t\t\tlet rightPoint = clickedX + (width * zoomRatio) / 2\n\t\t\t\t\tif (rightPoint > width) {\n\t\t\t\t\t\trightPoint = width\n\t\t\t\t\t}\n\t\t\t\t\t// updateZoomDomain assumes max range is [0, width]\n\t\t\t\t\tupdateZoomDomain(leftPoint, rightPoint)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}\n}\n","import { cloneDeep, isEmpty, merge } from 'lodash-es'\nimport { area, brushX, extent, line } from 'd3'\nimport { getProperty } from '@/tools'\nimport { zoomBar as zoomBarConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport type { ChartModelCartesian } from '@/model/cartesian-charts'\nimport { AxisPositions, Events, RenderTypes, ScaleTypes, ZoomBarTypes } from '@/interfaces/enums'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\n\nexport class ZoomBar extends Component {\n\ttype = 'zoom-bar'\n\trenderType = RenderTypes.SVG\n\n\t// The minimum selection x range to trigger handler update\n\t// Smaller number may introduce a handler flash during initialization\n\t// Bigger number may not trigger handler update while selection area on chart is very small\n\tMIN_SELECTION_DIFF = 9e-10\n\n\t// needs to match the style in _zoom-bar.scss\n\tbrushSelector = 'g.zoom-bar-brush'\n\n\t// The max allowed selection range, will be updated soon in render()\n\tmaxSelectionRange: [0, 0]\n\n\t// Give every zoomBarClip a distinct ID\n\t// so they don't interfere the other zoom bars in a page\n\tclipId = 'zoomBarClip-' + Math.floor(Math.random() * 99999999999)\n\n\tbrush = brushX()\n\txScale: any\n\tyScale: any\n\n\thighlightStrokeWidth = 1\n\n\tprotected model: ChartModelCartesian\n\n\tinit() {\n\t\tthis.services.events.addEventListener(Events.ZoomBar.UPDATE, this.render.bind(this))\n\t\t// check if pre-defined zoom bar data exists\n\t\tconst definedZoomBarData = getProperty(this.getOptions(), 'zoomBar', AxisPositions.TOP, 'data')\n\n\t\t// load up the zoomBarData into this model\n\t\tthis.model.setZoomBarData(definedZoomBarData)\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer()\n\n\t\tconst isTopZoomBarLoading = this.services.zoom.isZoomBarLoading(AxisPositions.TOP)\n\t\tconst isTopZoomBarLocked = this.services.zoom.isZoomBarLocked(AxisPositions.TOP)\n\n\t\tconst zoombarType = getProperty(this.getOptions(), 'zoomBar', AxisPositions.TOP, 'type') as\n\t\t\t| 'graph_view'\n\t\t\t| 'slider_view'\n\n\t\t// As zoom current only available on top only highlights corresponding to bottom axis will be shown\n\t\tconst highlight = getProperty(this.getOptions(), 'axes', AxisPositions.BOTTOM, 'highlights')\n\n\t\tconst zoombarHeight = zoomBarConfigs.height[zoombarType]\n\n\t\tconst { width } = DOMUtils.getSVGElementSize(this.parent as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\t\t// initialization is not completed yet\n\t\tif (width === 0) {\n\t\t\treturn\n\t\t}\n\t\t// get axes margins\n\t\tlet axesLeftMargin = 0\n\t\tconst axesMargins = this.model.get('axesMargins')\n\t\tif (axesMargins && axesMargins.left) {\n\t\t\taxesLeftMargin = axesMargins.left\n\t\t}\n\n\t\tconst container = DOMUtils.appendOrSelect(svg, 'svg.zoom-container')\n\t\t\t.attr('width', '100%')\n\t\t\t.attr('height', zoombarHeight)\n\t\t\t.attr('opacity', 1)\n\n\t\tDOMUtils.appendOrSelect(svg, 'rect.zoom-spacer')\n\t\t\t.attr('x', 0)\n\t\t\t.attr('y', zoombarHeight)\n\t\t\t.attr('width', '100%')\n\t\t\t.attr('height', zoomBarConfigs.spacerHeight)\n\t\t\t.attr('opacity', 1)\n\t\t\t.attr('fill', 'none')\n\n\t\tif (zoombarType === ZoomBarTypes.GRAPH_VIEW) {\n\t\t\t// Draw zoombar background rectangle\n\t\t\tDOMUtils.appendOrSelect(container, 'rect.zoom-bg')\n\t\t\t\t.attr('x', axesLeftMargin)\n\t\t\t\t.attr('y', 0)\n\t\t\t\t.attr('width', width - axesLeftMargin)\n\t\t\t\t.attr('height', '100%')\n\t\t\t\t.classed('zoom-bg-skeleton', isTopZoomBarLoading)\n\t\t\t\t.style(\n\t\t\t\t\t'stroke',\n\t\t\t\t\tisTopZoomBarLoading\n\t\t\t\t\t\t? `url(#${this.services.domUtils.generateElementIDString(`shimmer-lines`)})`\n\t\t\t\t\t\t: null\n\t\t\t\t)\n\t\t} else if (zoombarType === ZoomBarTypes.SLIDER_VIEW) {\n\t\t\t// Draw zoombar background line\n\t\t\tDOMUtils.appendOrSelect(container, 'rect.zoom-slider-bg')\n\t\t\t\t.attr('x', axesLeftMargin)\n\t\t\t\t.attr('y', zoombarHeight / 2 - 1)\n\t\t\t\t.attr('width', width - axesLeftMargin)\n\t\t\t\t.attr('height', 2)\n\t\t\t\t.classed('zoom-slider-bg-skeleton', isTopZoomBarLoading)\n\t\t\t\t.style(\n\t\t\t\t\t'stroke',\n\t\t\t\t\tisTopZoomBarLoading\n\t\t\t\t\t\t? `url(#${this.services.domUtils.generateElementIDString(`shimmer-lines`)})`\n\t\t\t\t\t\t: null\n\t\t\t\t)\n\t\t}\n\n\t\tif (isTopZoomBarLoading) {\n\t\t\tthis.renderSkeleton(container, axesLeftMargin, width)\n\t\t\treturn\n\t\t}\n\n\t\tconst { cartesianScales } = this.services\n\t\tconst mainXScale = cartesianScales.getMainXScale()\n\t\tconst mainYScale = cartesianScales.getMainYScale()\n\t\tconst mainXScaleType = cartesianScales.getMainXScaleType()\n\n\t\tif (mainXScale && mainXScaleType === ScaleTypes.TIME) {\n\t\t\tlet zoomBarData = this.services.zoom.getZoomBarData()\n\n\t\t\t// if there's no zoom bar data we can't do anything (true, undefined, null...)\n\t\t\t// if zoom domain is based on a single data element\n\t\t\t// doesn't make sense to allow zooming in\n\t\t\tif (isEmpty(zoomBarData) || zoomBarData.length === 1) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.xScale = mainXScale.copy()\n\t\t\tthis.yScale = mainYScale.copy()\n\n\t\t\tconst defaultDomain = this.services.zoom.getDefaultZoomBarDomain(zoomBarData)\n\n\t\t\t// add value 0 to the extended domain for zoom bar area graph\n\t\t\tzoomBarData = this.compensateDataForDefaultDomain(zoomBarData, defaultDomain)\n\n\t\t\t// get old initialZoomDomain from model\n\t\t\tconst oldInitialZoomDomain = this.model.get('initialZoomDomain')\n\t\t\t// get new initialZoomDomain from option\n\t\t\tconst newInitialZoomDomain = getProperty(\n\t\t\t\tthis.getOptions(),\n\t\t\t\t'zoomBar',\n\t\t\t\tAxisPositions.TOP,\n\t\t\t\t'initialZoomDomain'\n\t\t\t)\n\t\t\t// change string date to Date object if necessary\n\t\t\tif (newInitialZoomDomain && newInitialZoomDomain[0] && newInitialZoomDomain[1]) {\n\t\t\t\tnewInitialZoomDomain[0] = new Date(newInitialZoomDomain[0])\n\t\t\t\tnewInitialZoomDomain[1] = new Date(newInitialZoomDomain[1])\n\t\t\t}\n\t\t\t// update initialZoomDomain and set zoomDomain in model only if the option is changed\n\t\t\t// not the same object, and both start date and end date are not equal\n\t\t\tif (\n\t\t\t\tnewInitialZoomDomain &&\n\t\t\t\t!(\n\t\t\t\t\toldInitialZoomDomain &&\n\t\t\t\t\toldInitialZoomDomain[0].valueOf() === newInitialZoomDomain[0].valueOf() &&\n\t\t\t\t\toldInitialZoomDomain[1].valueOf() === newInitialZoomDomain[1].valueOf()\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tthis.model.set(\n\t\t\t\t\t{\n\t\t\t\t\t\t// use a new object instead of newInitialZoomDomain\n\t\t\t\t\t\tinitialZoomDomain: merge([], newInitialZoomDomain),\n\t\t\t\t\t\tzoomDomain: newInitialZoomDomain ? merge([], newInitialZoomDomain) : defaultDomain\n\t\t\t\t\t},\n\t\t\t\t\t{ skipUpdate: true }\n\t\t\t\t)\n\t\t\t} else if (newInitialZoomDomain === null && oldInitialZoomDomain !== null) {\n\t\t\t\t// if newInitialZoomDomain is set to null (when oldInitialZoomDomain is not null)\n\t\t\t\t// save initialZoomDomain and reset zoom domain to default domain\n\t\t\t\tthis.model.set(\n\t\t\t\t\t{\n\t\t\t\t\t\tinitialZoomDomain: null,\n\t\t\t\t\t\tzoomDomain: merge([], defaultDomain)\n\t\t\t\t\t},\n\t\t\t\t\t{ skipUpdate: true }\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tthis.xScale.range([axesLeftMargin, width]).domain(defaultDomain)\n\n\t\t\t// keep max selection range\n\t\t\tthis.maxSelectionRange = this.xScale.range()\n\n\t\t\tthis.yScale.range([0, zoombarHeight - 6]).domain(extent(zoomBarData, (d: any) => d.value))\n\n\t\t\tconst zoomDomain = this.model.get('zoomDomain')\n\n\t\t\tif (zoombarType === ZoomBarTypes.GRAPH_VIEW) {\n\t\t\t\tthis.renderZoomBarArea(container, 'path.zoom-graph-area-unselected', zoomBarData, null)\n\t\t\t\tthis.updateClipPath(svg, this.clipId, 0, 0, 0, 0)\n\t\t\t\tthis.renderZoomBarArea(container, 'path.zoom-graph-area', zoomBarData, this.clipId)\n\t\t\t\t// Draw the zoom bar base line\n\t\t\t\tthis.renderZoomBarBaseline(container as any, axesLeftMargin, width)\n\n\t\t\t\tif (highlight) {\n\t\t\t\t\tconst startHighlight = highlight.highlightStartMapsTo\n\t\t\t\t\tconst endHighlight = highlight.highlightEndMapsTo\n\t\t\t\t\tconst color = highlight.color\n\t\t\t\t\tconst labelMapTo = highlight.labelMapsTo\n\n\t\t\t\t\thighlight.data.forEach((element: any, index: number) => {\n\t\t\t\t\t\tDOMUtils.appendOrSelect(container, `rect.highlight-${index}`)\n\t\t\t\t\t\t\t.attr('height', zoombarHeight - 2 * this.highlightStrokeWidth)\n\t\t\t\t\t\t\t.attr('y', this.highlightStrokeWidth)\n\t\t\t\t\t\t\t.attr('x', this.xScale(element[startHighlight]))\n\t\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t\t'width',\n\t\t\t\t\t\t\t\tthis.xScale(element[endHighlight]) - this.xScale(element[startHighlight])\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.style(\n\t\t\t\t\t\t\t\t'fill',\n\t\t\t\t\t\t\t\tcolor && color.scale[element[labelMapTo]] ? color.scale[element[labelMapTo]] : null\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.style('fill-opacity', 0.1)\n\t\t\t\t\t\t\t.style(\n\t\t\t\t\t\t\t\t'stroke',\n\t\t\t\t\t\t\t\tcolor && color.scale[element[labelMapTo]] ? color.scale[element[labelMapTo]] : null\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.style('stroke-dasharray', '2, 2')\n\t\t\t\t\t\t\t.attr('stroke-width', 1 + 'px')\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Attach brushing event listeners\n\t\t\tthis.addBrushEventListener(zoomDomain, axesLeftMargin, width)\n\n\t\t\t// Draw the brushing area\n\t\t\tconst brushArea = DOMUtils.appendOrSelect(svg, this.brushSelector).call(this.brush)\n\n\t\t\tif (zoomDomain === undefined) {\n\t\t\t\t// do nothing, initialization not completed yet\n\t\t\t\t// don't update brushHandle to avoid flash\n\t\t\t} else if (zoomDomain[0].valueOf() === zoomDomain[1].valueOf()) {\n\t\t\t\tbrushArea.call(this.brush.move, this.xScale.range()) // default to full range\n\t\t\t\tthis.updateBrushHandle(this.getComponentContainer(), this.xScale.range())\n\t\t\t} else {\n\t\t\t\tconst selected = zoomDomain.map((domain: any) => this.xScale(domain))\n\t\t\t\tif (selected[1] - selected[0] < this.MIN_SELECTION_DIFF) {\n\t\t\t\t\t// initialization not completed yet\n\t\t\t\t\t// don't update brushHandle to avoid flash\n\t\t\t\t} else {\n\t\t\t\t\tbrushArea.call(this.brush.move, selected) // set brush to correct position\n\t\t\t\t\tthis.updateBrushHandle(this.getComponentContainer(), selected)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isTopZoomBarLocked) {\n\t\t\t\tthis.brush.filter(() => {\n\t\t\t\t\treturn false\n\t\t\t\t})\n\t\t\t\t// reset all cursor to auto\n\t\t\t\tbrushArea.selectAll('rect').attr('cursor', 'auto')\n\t\t\t}\n\t\t}\n\t}\n\n\taddBrushEventListener(zoomDomain: any, axesLeftMargin: any, width: any) {\n\t\tconst brushEventListener = (event: any) => {\n\t\t\tconst selection = event.selection\n\t\t\t// follow d3 behavior: when selection is null, reset default full range\n\t\t\t// select behavior is completed, but nothing selected\n\t\t\tif (selection === null) {\n\t\t\t\tthis.handleBrushedEvent(event, zoomDomain, this.xScale, this.xScale.range())\n\t\t\t} else if (selection[0] === selection[1]) {\n\t\t\t\t// select behavior is not completed yet, do nothing\n\t\t\t} else {\n\t\t\t\tthis.handleBrushedEvent(event, zoomDomain, this.xScale, selection)\n\t\t\t}\n\t\t}\n\n\t\tconst zoombarType = getProperty(this.getOptions(), 'zoomBar', AxisPositions.TOP, 'type') as\n\t\t\t| 'graph_view'\n\t\t\t| 'slider_view'\n\t\tconst zoombarHeight = zoomBarConfigs.height[zoombarType]\n\n\t\t// Initialize the d3 brush\n\t\tthis.brush\n\t\t\t.extent([\n\t\t\t\t[axesLeftMargin, 0],\n\t\t\t\t[width, zoombarHeight]\n\t\t\t])\n\t\t\t.on('start brush end', null) // remove old listener first\n\t\t\t.on('start brush end', brushEventListener)\n\t}\n\n\t// brush event listener\n\thandleBrushedEvent(event: any, zoomDomain: any, scale: any, selection: any) {\n\t\tconst newDomain = [scale.invert(selection[0]), scale.invert(selection[1])]\n\n\t\t// update brush handle position\n\t\tthis.updateBrushHandle(this.getComponentContainer(), selection)\n\n\t\t// be aware that the value of d3.event changes during an event!\n\t\t// update zoomDomain only if the event comes from mouse/touch event\n\t\tif (\n\t\t\tevent.sourceEvent != null &&\n\t\t\t(event.sourceEvent.type === 'mousemove' ||\n\t\t\t\tevent.sourceEvent.type === 'mouseup' ||\n\t\t\t\tevent.sourceEvent.type === 'mousedown' ||\n\t\t\t\tevent.sourceEvent.type === 'touchstart' ||\n\t\t\t\tevent.sourceEvent.type === 'touchmove' ||\n\t\t\t\tevent.sourceEvent.type === 'touchend')\n\t\t) {\n\t\t\t// only if zoomDomain is never set or needs update\n\t\t\tif (\n\t\t\t\tzoomDomain === undefined ||\n\t\t\t\tzoomDomain[0] !== newDomain[0] ||\n\t\t\t\tzoomDomain[1] !== newDomain[1]\n\t\t\t) {\n\t\t\t\t// don't dispatch event for all event types\n\t\t\t\t// let the following code to dispatch necessary events\n\t\t\t\tthis.services.zoom.handleDomainChange(newDomain, {\n\t\t\t\t\tdispatchEvent: false\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// dispatch selection events\n\t\t\tlet zoomBarEventType\n\t\t\tif (event.type === 'start') {\n\t\t\t\tzoomBarEventType = Events.ZoomBar.SELECTION_START\n\t\t\t} else if (event.type === 'brush') {\n\t\t\t\tzoomBarEventType = Events.ZoomBar.SELECTION_IN_PROGRESS\n\t\t\t} else if (event.type === 'end') {\n\t\t\t\tzoomBarEventType = Events.ZoomBar.SELECTION_END\n\t\t\t\t// only dispatch zoom domain change event for triggering api call when event type equals to end\n\t\t\t\tthis.services.events.dispatchEvent(Events.ZoomDomain.CHANGE, {\n\t\t\t\t\tnewDomain\n\t\t\t\t})\n\t\t\t}\n\t\t\tthis.services.events.dispatchEvent(zoomBarEventType, {\n\t\t\t\tselection,\n\t\t\t\tnewDomain\n\t\t\t})\n\t\t}\n\t}\n\n\tupdateBrushHandle(svg: any, selection: any) {\n\t\tconst self = this\n\t\tconst handleWidth = zoomBarConfigs.handleWidth\n\n\t\tconst zoombarType = getProperty(this.getOptions(), 'zoomBar', AxisPositions.TOP, 'type') as\n\t\t\t| 'graph_view'\n\t\t\t| 'slider_view'\n\t\tconst handleHeight = zoomBarConfigs.height[zoombarType]\n\t\tconst handleXDiff = -handleWidth / 2\n\n\t\tconst handleBarWidth = zoomBarConfigs.handleBarWidth\n\t\tconst handleBarHeight =\n\t\t\tzoombarType === ZoomBarTypes.GRAPH_VIEW ? zoomBarConfigs.handleBarHeight : 6\n\t\tconst handleBarXDiff = -handleBarWidth / 2\n\t\tconst handleYBarDiff = (handleHeight - handleBarHeight) / 2\n\n\t\t// handle\n\t\tsvg\n\t\t\t.select(this.brushSelector)\n\t\t\t.selectAll('rect.handle')\n\t\t\t.data([{ type: 'w' }, { type: 'e' }])\n\t\t\t.attr('x', function (d: any) {\n\t\t\t\tif (d.type === 'w') {\n\t\t\t\t\t// handle should not exceed zoom bar range\n\t\t\t\t\treturn Math.max(selection[0] + handleXDiff, self.maxSelectionRange[0])\n\t\t\t\t} else if (d.type === 'e') {\n\t\t\t\t\t// handle should not exceed zoom bar range\n\t\t\t\t\treturn Math.min(selection[1] + handleXDiff, self.maxSelectionRange[1] - handleWidth)\n\t\t\t\t}\n\t\t\t})\n\t\t\t.attr('y', 0)\n\t\t\t.attr('width', handleWidth)\n\t\t\t.attr('height', handleHeight)\n\t\t\t.attr('cursor', 'ew-resize')\n\t\t\t.style('display', null) // always display\n\n\t\t// handle-bar\n\t\tconst handleBars = svg\n\t\t\t.select(this.brushSelector)\n\t\t\t.selectAll('rect.handle-bar')\n\t\t\t.data([{ type: 'w' }, { type: 'e' }])\n\t\t// create rect if not exists\n\t\thandleBars\n\t\t\t.enter()\n\t\t\t.append('rect')\n\t\t\t.attr('class', function (d: any) {\n\t\t\t\treturn 'handle-bar handle-bar--' + d.type\n\t\t\t})\n\t\t// update positions\n\t\thandleBars\n\t\t\t.attr('x', function (d: any) {\n\t\t\t\tif (d.type === 'w') {\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\tselection[0] + handleBarXDiff,\n\t\t\t\t\t\tself.maxSelectionRange[0] - handleXDiff + handleBarXDiff\n\t\t\t\t\t)\n\t\t\t\t} else if (d.type === 'e') {\n\t\t\t\t\treturn Math.min(\n\t\t\t\t\t\tselection[1] + handleBarXDiff,\n\t\t\t\t\t\tself.maxSelectionRange[1] + handleXDiff + handleBarXDiff\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t})\n\t\t\t.attr('y', handleYBarDiff)\n\t\t\t.attr('width', handleBarWidth)\n\t\t\t.attr('height', handleBarHeight)\n\t\t\t.attr('cursor', 'ew-resize')\n\n\t\t// Update slider selected area\n\t\tif (zoombarType === ZoomBarTypes.SLIDER_VIEW) {\n\t\t\tthis.updateSliderSelectedArea(selection)\n\t\t}\n\n\t\tthis.updateClipPath(\n\t\t\tsvg,\n\t\t\tthis.clipId,\n\t\t\tselection[0],\n\t\t\t0,\n\t\t\tselection[1] - selection[0],\n\t\t\thandleHeight\n\t\t)\n\t}\n\n\tupdateSliderSelectedArea(selection: any) {\n\t\tconst zoombarType = getProperty(this.getOptions(), 'zoomBar', AxisPositions.TOP, 'type') as\n\t\t\t| 'graph_view'\n\t\t\t| 'slider_view'\n\t\tconst zoombarHeight = zoomBarConfigs.height[zoombarType]\n\n\t\tconst svg = this.getComponentContainer()\n\t\tconst container = svg.select('svg.zoom-container')\n\n\t\t// Draw zoombar background line\n\t\tDOMUtils.appendOrSelect(container as any, 'rect.zoom-slider-selected-area')\n\t\t\t.attr('x', selection[0])\n\t\t\t.attr('y', zoombarHeight / 2 - 1)\n\t\t\t.attr('width', selection[1] - selection[0])\n\t\t\t.attr('height', 2)\n\t}\n\n\trenderZoomBarArea(container: any, querySelector: any, data: any, clipId: any) {\n\t\tconst { cartesianScales } = this.services\n\t\tconst mainXAxisPosition = cartesianScales.getMainXAxisPosition()\n\t\tconst mainYAxisPosition = cartesianScales.getMainYAxisPosition()\n\t\tconst mainXScaleType = cartesianScales.getMainXScaleType()\n\t\tconst mainYScaleType = cartesianScales.getMainYScaleType()\n\n\t\tconst accessorFunction = (scale: any, scaleType: any, axisPosition: any) => {\n\t\t\treturn (d: any) => {\n\t\t\t\treturn cartesianScales.getValueFromScale(scale, scaleType, axisPosition, d)\n\t\t\t}\n\t\t}\n\n\t\tconst xAccessor = accessorFunction(this.xScale, mainXScaleType, mainXAxisPosition)\n\t\tconst yAccessor = accessorFunction(this.yScale, mainYScaleType, mainYAxisPosition)\n\n\t\tconst zoombarType = getProperty(this.getOptions(), 'zoomBar', AxisPositions.TOP, 'type') as\n\t\t\t| 'graph_view'\n\t\t\t| 'slider_view'\n\t\tconst zoombarHeight = zoomBarConfigs.height[zoombarType]\n\t\tconst areaGenerator = area()\n\t\t\t.x((d: any) => xAccessor(d))\n\t\t\t.y0(zoombarHeight)\n\t\t\t.y1((d: any) => zoombarHeight - yAccessor(d))\n\n\t\tconst areaGraph = DOMUtils.appendOrSelect(container, querySelector)\n\t\t\t.datum(data)\n\t\t\t.attr('d', areaGenerator)\n\n\t\tif (clipId) {\n\t\t\tareaGraph.attr('clip-path', `url(#${clipId})`)\n\t\t}\n\t}\n\n\tupdateClipPath(\n\t\tsvg: any,\n\t\tclipId: string,\n\t\tx: number | string,\n\t\ty: number | string,\n\t\twidth: number | string,\n\t\theight: number | string\n\t) {\n\t\tconst zoomBarClipPath = DOMUtils.appendOrSelect(svg, `clipPath`).attr('id', clipId)\n\t\tDOMUtils.appendOrSelect(zoomBarClipPath, 'rect')\n\t\t\t.attr('x', x)\n\t\t\t.attr('y', y)\n\t\t\t.attr('width', width)\n\t\t\t.attr('height', height)\n\t}\n\n\t// assume the domains in data are already sorted\n\tcompensateDataForDefaultDomain(data: any, defaultDomain: any) {\n\t\tif (!data || data.length < 2) {\n\t\t\treturn\n\t\t}\n\t\tconst zoomBarData = cloneDeep(data)\n\n\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier()\n\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier()\n\n\t\t// if min domain is extended\n\t\tif (Number(defaultDomain[0]) < Number(zoomBarData[0][domainIdentifier])) {\n\t\t\tconst newDatum: any = {}\n\t\t\tnewDatum[domainIdentifier] = defaultDomain[0]\n\t\t\tnewDatum[rangeIdentifier] = 0\n\t\t\tzoomBarData.unshift(newDatum)\n\t\t}\n\t\t// if max domain is extended\n\t\tif (Number(defaultDomain[1]) > Number(zoomBarData[zoomBarData.length - 1][domainIdentifier])) {\n\t\t\tconst newDatum: any = {}\n\t\t\tnewDatum[domainIdentifier] = defaultDomain[1]\n\t\t\tnewDatum[rangeIdentifier] = 0\n\t\t\tzoomBarData.push(newDatum)\n\t\t}\n\t\treturn zoomBarData\n\t}\n\n\trenderZoomBarBaseline(\n\t\tcontainer: HTMLElement,\n\t\tstartX: number,\n\t\tendX: number,\n\t\tskeletonClass = false\n\t) {\n\t\tconst zoombarType = getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'type'\n\t\t) as 'graph_view' | 'slider_view'\n\t\tconst zoombarHeight = zoomBarConfigs.height[zoombarType]\n\t\tconst baselineGenerator = line()([\n\t\t\t[startX, zoombarHeight],\n\t\t\t[endX, zoombarHeight]\n\t\t])\n\t\tDOMUtils.appendOrSelect(container as any, 'path.zoom-bg-baseline')\n\t\t\t.attr('d', baselineGenerator)\n\t\t\t.classed('zoom-bg-baseline-skeleton', skeletonClass)\n\t\t\t.style(\n\t\t\t\t'stroke',\n\t\t\t\tskeletonClass\n\t\t\t\t\t? `url(#${this.services.domUtils.generateElementIDString(`shimmer-lines`)})`\n\t\t\t\t\t: null\n\t\t\t)\n\t}\n\n\trenderSkeleton(container: any, startX: number, endX: number) {\n\t\t// need to clear current zoom bar area\n\t\tthis.renderZoomBarArea(container, 'path.zoom-graph-area-unselected', [], null)\n\t\tthis.renderZoomBarArea(container, 'path.zoom-graph-area', [], this.clipId)\n\t\t// remove brush listener\n\t\tthis.brush.on('start brush end', null)\n\t\t// clear d3 brush\n\t\tDOMUtils.appendOrSelect(this.getComponentContainer(), this.brushSelector).html(null)\n\n\t\t// re-render baseline because no axis labels in skeleton so the baseline length needs to change\n\t\tconst zoombarType = getProperty(this.getOptions(), 'zoomBar', AxisPositions.TOP, 'type')\n\t\tif (zoombarType === ZoomBarTypes.GRAPH_VIEW) {\n\t\t\tthis.renderZoomBarBaseline(container, startX, endX, true)\n\t\t}\n\t}\n\n\tdestroy() {\n\t\tthis.brush.on('start brush end', null) // remove event listener\n\t\tthis.services.events.removeEventListener(Events.ZoomBar.UPDATE, this.render.bind(this))\n\t}\n}\n","import { select, pointer, type ScaleBand } from 'd3'\nimport Position, { PLACEMENTS } from '@carbon/utils-position' // position services\nimport { flipDomainAndRangeBasedOnOrientation, getProperty } from '@/tools'\nimport { carbonPrefix } from '@/configuration-non-customizable' // CSS prefix\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport type { ChartModel } from '@/model/model'\nimport { AxisPositions, Events, RenderTypes, ScaleTypes } from '@/interfaces/enums'\nimport { formatTick, computeTimeIntervalName } from '@/services/time-series'\nimport { sanitizeText } from '@/utils/sanitizeHtml'\n\nexport class Threshold extends Component {\n\ttype = 'threshold'\n\trenderType = RenderTypes.SVG\n\n\tlabel: any\n\n\tpositionService = new Position()\n\n\tconstructor(model: ChartModel, services: any) {\n\t\tsuper(model, services)\n\t}\n\n\trender(animate = false) {\n\t\tconst axesOptions = getProperty(this.getOptions(), 'axes')\n\n\t\tconst thresholdData: any[] = []\n\n\t\tObject.keys(axesOptions).forEach(axisPosition => {\n\t\t\tif (Object.values(AxisPositions).includes(axisPosition as any)) {\n\t\t\t\tconst axisOptions = axesOptions[axisPosition]\n\n\t\t\t\tif (axisOptions.thresholds && axisOptions.thresholds.length > 0) {\n\t\t\t\t\tthresholdData.push({\n\t\t\t\t\t\taxisPosition,\n\t\t\t\t\t\tthresholds: axisOptions.thresholds,\n\t\t\t\t\t\tcorrespondingDatasets: axisOptions?.correspondingDatasets,\n\t\t\t\t\t\tmapsTo: axisOptions?.mapsTo\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true })\n\n\t\t// Update data on all axis threshold groups\n\t\tconst thresholdAxisGroups = svg\n\t\t\t.selectAll('g.axis-thresholds')\n\t\t\t.data(thresholdData, (d: any) => d.axisPosition)\n\n\t\t// Remove axis threshold groups that are no longer needed\n\t\tthresholdAxisGroups.exit().attr('opacity', 0).remove()\n\n\t\t// Add the axis threshold groups that need to be introduced\n\t\tconst thresholdAxisGroupsEnter = thresholdAxisGroups.enter().append('g')\n\n\t\tconst thresholdAxisGroupsMerge = thresholdAxisGroupsEnter.merge(thresholdAxisGroups as any)\n\t\tthresholdAxisGroupsMerge.attr('class', (d: any) => `axis-thresholds ${d.axisPosition}`)\n\n\t\tconst thresholdGroups = thresholdAxisGroupsMerge.selectAll('g.threshold-group').data((d: any) =>\n\t\t\td.thresholds.map((threshold: any) => {\n\t\t\t\t// Merge relevant keys into the threshold object\n\t\t\t\tthreshold.axisPosition = d.axisPosition\n\t\t\t\tthreshold.datum = this.constructDatumObj(d, threshold)\n\t\t\t\treturn threshold\n\t\t\t})\n\t\t)\n\n\t\t// Remove threshold groups that are no longer needed\n\t\tthresholdGroups.exit().attr('opacity', 0).remove()\n\n\t\t// Add the threshold groups that need to be introduced\n\t\tconst thresholdGroupsEnter = thresholdGroups.enter().append('g')\n\n\t\tthresholdGroupsEnter.append('line').attr('class', 'threshold-line')\n\t\tthresholdGroupsEnter.append('rect').attr('class', 'threshold-hoverable-area')\n\n\t\tconst thresholdGroupsMerge = thresholdGroupsEnter.merge(thresholdGroups as any)\n\t\tthresholdGroupsMerge.attr('class', 'threshold-group')\n\n\t\tconst self = this\n\t\tthresholdAxisGroupsMerge.each(function ({ axisPosition }: { axisPosition: AxisPositions }) {\n\t\t\tconst scale = self.services.cartesianScales.getScaleByPosition(\n\t\t\t\taxisPosition\n\t\t\t) as unknown as ScaleBand<string>\n\t\t\tconst scaleType = self.services.cartesianScales.getScaleTypeByPosition(axisPosition)\n\n\t\t\tlet xScale = null\n\t\t\tlet yScale = null\n\n\t\t\t// Depending on type of axis position, assign scale and main perpendicular axis\n\t\t\tif (axisPosition === AxisPositions.LEFT || axisPosition === AxisPositions.RIGHT) {\n\t\t\t\tyScale = scale\n\t\t\t\txScale = self.services.cartesianScales.getMainXScale()\n\t\t\t} else {\n\t\t\t\txScale = scale\n\t\t\t\tyScale = self.services.cartesianScales.getMainYScale()\n\t\t\t}\n\n\t\t\tconst isScaleTypeLabels = scaleType === ScaleTypes.LABELS\n\t\t\tconst [xScaleStart, xScaleEnd] = xScale.range()\n\t\t\tconst [yScaleEnd, yScaleStart] = yScale.range()\n\n\t\t\tconst { cartesianScales } = self.services\n\t\t\tconst orientation = cartesianScales.getOrientation()\n\t\t\tconst getDomainValue = (d: any) => cartesianScales.getDomainValue(d) as number\n\t\t\tconst getRangeValue = (d: any) => cartesianScales.getRangeValue(d) as number\n\t\t\tconst [getXValue, getYValue] = flipDomainAndRangeBasedOnOrientation(\n\t\t\t\tgetDomainValue,\n\t\t\t\tgetRangeValue,\n\t\t\t\torientation\n\t\t\t)\n\n\t\t\tconst group = select(this)\n\t\t\tif (axisPosition === AxisPositions.TOP || axisPosition === AxisPositions.BOTTOM) {\n\t\t\t\tgroup\n\t\t\t\t\t.selectAll('line.threshold-line')\n\t\t\t\t\t.transition()\n\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\tname: 'threshold-line-update',\n\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.attr('y1', yScaleStart)\n\t\t\t\t\t.attr('y2', yScaleEnd)\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'x1',\n\t\t\t\t\t\t({ datum }: { datum: any }) =>\n\t\t\t\t\t\t\tgetXValue(datum) + (isScaleTypeLabels ? scale.step() / 2 : 0)\n\t\t\t\t\t)\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'x2',\n\t\t\t\t\t\t({ datum }: { datum: any }) =>\n\t\t\t\t\t\t\tgetXValue(datum) + (isScaleTypeLabels ? scale.step() / 2 : 0)\n\t\t\t\t\t)\n\t\t\t\t\t.style('stroke', ({ fillColor }: { fillColor: string }) => fillColor)\n\n\t\t\t\t// Set hoverable area width and rotate it\n\t\t\t\tgroup\n\t\t\t\t\t.selectAll('rect.threshold-hoverable-area')\n\t\t\t\t\t.attr('x', 0)\n\t\t\t\t\t.attr('y', ({ datum }: { datum: any }) => -getXValue(datum))\n\t\t\t\t\t.attr('width', Math.abs(yScaleEnd - yScaleStart))\n\t\t\t\t\t.classed('rotate', true)\n\t\t\t} else {\n\t\t\t\tgroup\n\t\t\t\t\t.selectAll('line.threshold-line')\n\t\t\t\t\t.transition()\n\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\tname: 'threshold-line-update',\n\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.attr('x1', xScaleStart)\n\t\t\t\t\t.attr('x2', xScaleEnd)\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'y1',\n\t\t\t\t\t\t({ datum }: { datum: any }) =>\n\t\t\t\t\t\t\tgetYValue(datum) + (isScaleTypeLabels ? scale.step() / 2 : 0)\n\t\t\t\t\t)\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'y2',\n\t\t\t\t\t\t({ datum }: { datum: any }) =>\n\t\t\t\t\t\t\tgetYValue(datum) + (isScaleTypeLabels ? scale.step() / 2 : 0)\n\t\t\t\t\t)\n\t\t\t\t\t.style('stroke', ({ fillColor }: { fillColor: string }) => fillColor)\n\n\t\t\t\t// Set hoverable area width\n\t\t\t\tgroup\n\t\t\t\t\t.selectAll('rect.threshold-hoverable-area')\n\t\t\t\t\t.attr('x', xScaleStart)\n\t\t\t\t\t.attr('y', ({ datum }: { datum: any }) => getYValue(datum))\n\t\t\t\t\t.attr('width', Math.abs(xScaleEnd - xScaleStart))\n\t\t\t\t\t.classed('rotate', false)\n\t\t\t}\n\t\t})\n\n\t\t// Add event listener for showing the threshold tooltip\n\t\tthis.services.events.addEventListener(Events.Threshold.SHOW, (e: any) => {\n\t\t\tthis.setThresholdLabelPosition(e.detail)\n\n\t\t\tthis.label.classed('hidden', false)\n\t\t})\n\n\t\t// Add event listener for hiding the threshold tooltip\n\t\tthis.services.events.addEventListener(Events.Threshold.HIDE, () => {\n\t\t\tthis.label.classed('hidden', true)\n\t\t})\n\n\t\tthis.appendThresholdLabel()\n\n\t\tthis.addEventListeners()\n\t}\n\n\tgetFormattedValue(datum: any) {\n\t\tconst { value, axisPosition } = datum\n\t\tconst options = this.getOptions()\n\t\tconst scaleType = this.services.cartesianScales.getScaleTypeByPosition(axisPosition)\n\n\t\t// If scale is time, format the threshold date as the ticks format\n\t\tif (scaleType === ScaleTypes.TIME) {\n\t\t\tconst isVertical = [AxisPositions.LEFT, AxisPositions.RIGHT].includes(axisPosition)\n\t\t\tconst mainXScale = this.services.cartesianScales.getMainXScale()\n\t\t\tconst mainYScale = this.services.cartesianScales.getMainYScale()\n\t\t\tconst scale = isVertical ? mainYScale : mainXScale\n\n\t\t\tconst timeScaleOptions = getProperty(options, 'timeScale')\n\t\t\tconst timeInterval = computeTimeIntervalName(\n\t\t\t\tscale.ticks(),\n\t\t\t\tgetProperty(timeScaleOptions, 'timeInterval')\n\t\t\t)\n\n\t\t\treturn formatTick(value, 0, scale.ticks(), timeInterval, timeScaleOptions)\n\t\t}\n\n\t\treturn value.toLocaleString('en')\n\t}\n\n\tappendThresholdLabel() {\n\t\tconst holder = select(this.services.domUtils.getHolder())\n\n\t\tconst chartprefix = getProperty(this.getOptions(), 'style', 'prefix')\n\n\t\tthis.label = DOMUtils.appendOrSelect(\n\t\t\tholder,\n\t\t\t`div.${carbonPrefix}--${chartprefix}--threshold--label`\n\t\t).classed('hidden', true)\n\t}\n\n\tsetThresholdLabelPosition({ event, datum }: { event: CustomEvent; datum: any }) {\n\t\tconst holder = this.services.domUtils.getHolder()\n\t\tconst mouseRelativePos = pointer(event, holder)\n\n\t\t// Format the threshold value using valueFormatter if defined in user-provided options\n\t\tconst formattedValue = datum.valueFormatter\n\t\t\t? datum.valueFormatter(datum.value)\n\t\t\t: this.getFormattedValue(datum)\n\n\t\tthis.label\n\t\t\t.html(sanitizeText(`${datum.label || 'Threshold'}: ${formattedValue}`))\n\t\t\t.style('background-color', datum.fillColor)\n\n\t\tconst target = this.label.node()\n\t\t// Find out whether threshold label should be shown on the left or right side\n\t\tconst bestPlacementOption = this.positionService.findBestPlacementAt(\n\t\t\t{\n\t\t\t\tleft: mouseRelativePos[0],\n\t\t\t\ttop: mouseRelativePos[1]\n\t\t\t},\n\t\t\ttarget,\n\t\t\t[PLACEMENTS.RIGHT, PLACEMENTS.LEFT, PLACEMENTS.TOP, PLACEMENTS.BOTTOM],\n\t\t\t() => ({\n\t\t\t\ttop: undefined, // other package lists this as non-optional\n\t\t\t\tleft: undefined, // ditto\n\t\t\t\twidth: holder.offsetWidth,\n\t\t\t\theight: holder.offsetHeight\n\t\t\t})\n\t\t)\n\n\t\t// Get coordinates to where label should be positioned\n\t\tconst pos = this.positionService.findPositionAt(\n\t\t\t{\n\t\t\t\tleft: mouseRelativePos[0],\n\t\t\t\ttop: mouseRelativePos[1]\n\t\t\t},\n\t\t\ttarget,\n\t\t\tbestPlacementOption\n\t\t)\n\n\t\tthis.positionService.setElement(target, pos)\n\t}\n\n\t// Constructs object to pass in scale functions\n\tconstructDatumObj(d: any, element: any) {\n\t\tconst datum: any = {}\n\n\t\t// We only need to specify group only if correpsonding dataset is defined\n\t\tif (d.correspondingDatasets) {\n\t\t\tdatum['group'] = getProperty(d, 'correspondingDatasets', 0)\n\t\t}\n\n\t\t// Add attribute with the mapsTo value as key\n\t\tdatum[d['mapsTo']] = element.value\n\n\t\treturn datum\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this\n\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true })\n\n\t\t// Add events to the threshold hoverable area\n\t\tsvg\n\t\t\t.selectAll('rect.threshold-hoverable-area')\n\t\t\t.on('mouseover mousemove', function (event: MouseEvent) {\n\t\t\t\tselect((this as any).parentNode)\n\t\t\t\t\t.select('line.threshold-line')\n\t\t\t\t\t.classed('active', true)\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Threshold.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement: select(this),\n\t\t\t\t\tdatum: select(this).datum()\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent) {\n\t\t\t\tselect((this as any).parentNode)\n\t\t\t\t\t.select('line.threshold-line')\n\t\t\t\t\t.classed('active', false)\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Threshold.HIDE, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement: select(this),\n\t\t\t\t\tdatum: select(this).datum()\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n","import { select } from 'd3'\nimport Position from '@carbon/utils-position' // position service\nimport { flipDomainAndRangeBasedOnOrientation, getProperty } from '@/tools'\nimport { Component } from '@/components/component'\nimport type { ChartModel } from '@/model/model'\nimport { AxisPositions, type CartesianOrientations, RenderTypes } from '@/interfaces/enums'\n\nexport class Highlight extends Component {\n\ttype = 'highlight'\n\trenderType = RenderTypes.SVG\n\n\tlabel: any\n\n\tpositionService = new Position()\n\thighlightStrokeWidth = 1\n\n\tconstructor(model: ChartModel, services: any) {\n\t\tsuper(model, services)\n\t}\n\n\trender(animate = false) {\n\t\tconst axesOptions = getProperty(this.getOptions(), 'axes')\n\t\tconst highlightData: any[] = []\n\n\t\tObject.keys(axesOptions).forEach((axisPosition: any) => {\n\t\t\tif (Object.values(AxisPositions).includes(axisPosition as any)) {\n\t\t\t\tconst axisOptions = axesOptions[axisPosition]\n\t\t\t\tif (axisOptions.highlights && axisOptions.highlights.data.length > 0) {\n\t\t\t\t\thighlightData.push({\n\t\t\t\t\t\taxisPosition,\n\t\t\t\t\t\thighlightStartMapsTo: axisOptions.highlights.highlightStartMapsTo,\n\t\t\t\t\t\thighlightEndMapsTo: axisOptions.highlights.highlightEndMapsTo,\n\t\t\t\t\t\tlabelMapsTo: axisOptions.highlights.labelMapsTo,\n\t\t\t\t\t\thighlight: axisOptions.highlights.data,\n\t\t\t\t\t\tcolor: axisOptions.highlights.color\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true })\n\n\t\t// Update data on all axis highlight groups\n\t\tconst highlightAxisGroups = svg\n\t\t\t.selectAll('g.axis-highlight')\n\t\t\t.data(highlightData, (d: any) => d.axisPosition)\n\n\t\t// Remove axis highlight groups that are no longer needed\n\t\thighlightAxisGroups.exit().attr('opacity', 0).remove()\n\n\t\t// Add the axis highlight groups that need to be introduced\n\t\tconst highlightAxisGroupsEnter = highlightAxisGroups.enter().append('g')\n\n\t\tconst highlightAxisGroupsMerge = highlightAxisGroupsEnter.merge(highlightAxisGroups as any)\n\t\thighlightAxisGroupsMerge.attr('class', (d: any) => `axis-highlight ${d.axisPosition}`)\n\n\t\tconst highlightGroups = highlightAxisGroupsMerge.selectAll('g.highlight-group').data((d: any) =>\n\t\t\td.highlight.map((highlight: any) => {\n\t\t\t\thighlight.axisPosition = d.axisPosition\n\t\t\t\thighlight.highlightStartMapsTo = d.highlightStartMapsTo\n\t\t\t\thighlight.labelMapsTo = d.labelMapsTo\n\t\t\t\thighlight.color = d.color\n\t\t\t\thighlight.highlightEndMapsTo = d.highlightEndMapsTo\n\t\t\t\treturn highlight\n\t\t\t})\n\t\t)\n\n\t\t// Remove highlight groups that are no longer needed\n\t\thighlightGroups.exit().attr('opacity', 0).remove()\n\n\t\t// Add the highlight groups that need to be introduced\n\t\tconst highlightGroupsEnter = highlightGroups.enter().append('g')\n\n\t\thighlightGroupsEnter.append('rect').attr('class', 'highlight-bar')\n\t\thighlightGroupsEnter.append('line').attr('class', 'highlight-line')\n\n\t\tconst highlightGroupsMerge = highlightGroupsEnter.merge(highlightGroups as any)\n\t\thighlightGroupsMerge.attr('class', 'highlight-group')\n\n\t\tconst self = this\n\t\thighlightAxisGroupsMerge.each(function ({ axisPosition }) {\n\t\t\tconst mainXScale = self.services.cartesianScales.getMainXScale()\n\t\t\tconst mainYScale = self.services.cartesianScales.getMainYScale()\n\t\t\tconst [xScaleStart, xScaleEnd] = mainXScale.range()\n\t\t\tconst [yScaleEnd, yScaleStart] = mainYScale.range()\n\n\t\t\tconst { cartesianScales } = self.services\n\t\t\tconst orientation = cartesianScales.getOrientation() as CartesianOrientations\n\t\t\tconst getDomainValue = (d: any) => cartesianScales.getDomainValue(d) as number\n\t\t\tconst getRangeValue = (d: any) => cartesianScales.getRangeValue(d) as number\n\t\t\tconst [getXValue, getYValue] = flipDomainAndRangeBasedOnOrientation(\n\t\t\t\tgetDomainValue,\n\t\t\t\tgetRangeValue,\n\t\t\t\torientation\n\t\t\t)\n\n\t\t\tconst group = select(this)\n\t\t\tif (axisPosition === AxisPositions.TOP || axisPosition === AxisPositions.BOTTOM) {\n\t\t\t\tgroup\n\t\t\t\t\t.selectAll('rect.highlight-bar')\n\t\t\t\t\t.transition()\n\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\tname: 'highlight-bar-update',\n\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t// Stroke width added to stop overflow of highlight\n\t\t\t\t\t.attr('y', Math.max(yScaleStart + self.highlightStrokeWidth, 0))\n\t\t\t\t\t// Stroke width subtracted to stop overflow of highlight\n\t\t\t\t\t.attr('height', Math.max(yScaleEnd - 2 * self.highlightStrokeWidth, 0))\n\t\t\t\t\t.attr('x', ({ highlightStartMapsTo, ...d }) => getXValue(d[highlightStartMapsTo]))\n\t\t\t\t\t.attr('width', ({ highlightStartMapsTo, highlightEndMapsTo, ...d }) =>\n\t\t\t\t\t\tMath.max(getXValue(d[highlightEndMapsTo]) - getXValue(d[highlightStartMapsTo]), 0)\n\t\t\t\t\t)\n\t\t\t\t\t.style('stroke', ({ color, labelMapsTo, ...data }) => {\n\t\t\t\t\t\treturn color && color.scale[data[labelMapsTo]] ? color.scale[data[labelMapsTo]] : null\n\t\t\t\t\t})\n\t\t\t\t\t.style('stroke-dasharray', '2, 2')\n\t\t\t\t\t.attr('stroke-width', self.highlightStrokeWidth + 'px')\n\t\t\t\t\t.style('fill-opacity', 0.1)\n\t\t\t\t\t.style('fill', ({ color, labelMapsTo, ...data }) => {\n\t\t\t\t\t\treturn color && color.scale[data[labelMapsTo]] ? color.scale[data[labelMapsTo]] : null\n\t\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tgroup\n\t\t\t\t\t.selectAll('rect.highlight-bar')\n\t\t\t\t\t.transition()\n\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\tname: 'highlight-bar-update',\n\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.attr('x', xScaleStart)\n\t\t\t\t\t.attr('width', Math.max(xScaleEnd - xScaleStart, 0))\n\t\t\t\t\t.attr('y', ({ highlightEndMapsTo, ...d }) => getYValue(d[highlightEndMapsTo]))\n\t\t\t\t\t.attr('height', ({ highlightStartMapsTo, highlightEndMapsTo, ...d }) =>\n\t\t\t\t\t\tMath.max(getYValue(d[highlightStartMapsTo]) - getYValue(d[highlightEndMapsTo]), 0)\n\t\t\t\t\t)\n\t\t\t\t\t.style('stroke', ({ color, labelMapsTo, ...data }) => {\n\t\t\t\t\t\treturn color && color.scale[data[labelMapsTo]] ? color.scale[data[labelMapsTo]] : null\n\t\t\t\t\t})\n\t\t\t\t\t.style('stroke-dasharray', '2, 2')\n\t\t\t\t\t.attr('stroke-width', self.highlightStrokeWidth + 'px')\n\t\t\t\t\t.style('fill-opacity', 0.1)\n\t\t\t\t\t.style('fill', ({ color, labelMapsTo, ...data }) => {\n\t\t\t\t\t\treturn color && color.scale[data[labelMapsTo]] ? color.scale[data[labelMapsTo]] : null\n\t\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n}\n","import { get } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { Tooltip } from './tooltip'\nimport { ColorClassNameTypes } from '@/interfaces/enums'\n\nexport class AxisChartsTooltip extends Tooltip {\n\tgetItems(e: CustomEvent) {\n\t\tif (e.detail.items) {\n\t\t\treturn e.detail.items\n\t\t}\n\n\t\tconst { data } = e.detail\n\t\tif (!data || !data.length || !data[0]) {\n\t\t\treturn []\n\t\t}\n\n\t\tconst options = this.getOptions()\n\t\tconst { cartesianScales } = this.services\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier()\n\t\tconst dualAxes = cartesianScales.isDualAxes()\n\n\t\t// Generate default tooltip\n\t\tconst { groupMapsTo } = options.data\n\t\tconst domainLabel = cartesianScales.getDomainLabel()\n\t\tlet rangeLabel = cartesianScales.getRangeLabel()\n\n\t\tconst domainValue = data[0][domainIdentifier]\n\t\tlet items: any[]\n\t\tif (data.length === 1) {\n\t\t\tconst datum = data[0]\n\t\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier(datum)\n\n\t\t\tif (dualAxes) {\n\t\t\t\tconst position = cartesianScales.getRangeAxisPosition({\n\t\t\t\t\tdatum,\n\t\t\t\t\tgroups: [datum[groupMapsTo]]\n\t\t\t\t})\n\t\t\t\trangeLabel = cartesianScales.getScaleLabel(position)\n\t\t\t}\n\t\t\tconst value = datum[rangeIdentifier]\n\n\t\t\titems = [\n\t\t\t\t{\n\t\t\t\t\tlabel: domainLabel,\n\t\t\t\t\tvalue: domainValue\n\t\t\t\t},\n\t\t\t\t...(Array.isArray(value) && value.length === 2\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: 'Start',\n\t\t\t\t\t\t\t\tvalue: value[0]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: 'End',\n\t\t\t\t\t\t\t\tvalue: value[1]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: rangeLabel,\n\t\t\t\t\t\t\t\tvalue: datum[rangeIdentifier]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t])\n\t\t\t]\n\n\t\t\tif (e.detail.additionalItems) {\n\t\t\t\te.detail.additionalItems.forEach((additionalItem: any) =>\n\t\t\t\t\titems.push({\n\t\t\t\t\t\tlabel: additionalItem.label,\n\t\t\t\t\t\tvalue: additionalItem.value\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t}\n\n\t\t\titems.push({\n\t\t\t\tlabel: options.tooltip.groupLabel,\n\t\t\t\tvalue: datum[groupMapsTo],\n\t\t\t\tcolor: this.model.getFillColor(datum[groupMapsTo]),\n\t\t\t\tclass: this.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.TOOLTIP],\n\t\t\t\t\tdataGroupName: datum[groupMapsTo]\n\t\t\t\t})\n\t\t\t})\n\t\t} else if (data.length > 1) {\n\t\t\titems = [\n\t\t\t\t{\n\t\t\t\t\tlabel: domainLabel,\n\t\t\t\t\tvalue: domainValue\n\t\t\t\t}\n\t\t\t]\n\n\t\t\titems = items.concat(\n\t\t\t\tdata\n\t\t\t\t\t.map((datum: any) => {\n\t\t\t\t\t\t// Format value if is array\n\t\t\t\t\t\tconst value = datum[cartesianScales.getRangeIdentifier(datum)]\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tlabel: datum[groupMapsTo],\n\t\t\t\t\t\t\tvalue:\n\t\t\t\t\t\t\t\tArray.isArray(value) && value.length === 2 ? `${value[0]} - ${value[1]}` : value,\n\t\t\t\t\t\t\tcolor: this.model.getFillColor(datum[groupMapsTo]),\n\t\t\t\t\t\t\tclass: this.model.getColorClassName({\n\t\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.TOOLTIP],\n\t\t\t\t\t\t\t\tdataGroupName: datum[groupMapsTo]\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.sort((a: any, b: any) => b.value - a.value)\n\t\t\t)\n\n\t\t\tif (!dualAxes && getProperty(options, 'tooltip', 'showTotal') === true) {\n\t\t\t\t// use the primary/only range id\n\t\t\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier()\n\t\t\t\titems.push({\n\t\t\t\t\tlabel: get(options, 'tooltip.totalLabel') || 'Total',\n\t\t\t\t\tvalue: data.reduce(\n\t\t\t\t\t\t(accumulator: number, datum: any) => accumulator + datum[rangeIdentifier],\n\t\t\t\t\t\t0\n\t\t\t\t\t),\n\t\t\t\t\tbold: true\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\treturn items\n\t}\n}\n","import {\n\textent,\n\tmax,\n\tscaleBand,\n\tscaleLinear,\n\tscaleTime,\n\tscaleLog,\n\ttype ScaleTime,\n\ttype ScaleBand,\n\ttype ScaleLinear\n} from 'd3'\nimport { differenceInYears } from 'date-fns/differenceInYears'\nimport { addYears } from 'date-fns/addYears'\nimport { subYears } from 'date-fns/subYears'\nimport { differenceInMonths } from 'date-fns/differenceInMonths'\nimport { addMonths } from 'date-fns/addMonths'\nimport { subMonths } from 'date-fns/subMonths'\nimport { differenceInDays } from 'date-fns/differenceInDays'\nimport { addDays } from 'date-fns/addDays'\nimport { subDays } from 'date-fns/subDays'\nimport { differenceInHours } from 'date-fns/differenceInHours'\nimport { addHours } from 'date-fns/addHours'\nimport { subHours } from 'date-fns/subHours'\nimport { differenceInMinutes } from 'date-fns/differenceInMinutes'\nimport { addMinutes } from 'date-fns/addMinutes'\nimport { subMinutes } from 'date-fns/subMinutes'\nimport { differenceInSeconds } from 'date-fns/differenceInSeconds'\nimport { subSeconds } from 'date-fns/subSeconds'\nimport { addSeconds } from 'date-fns/addSeconds'\nimport { flatten, uniq } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { axis as axisConfigs } from '@/configuration'\nimport { Service } from './service'\nimport { AxisPositions, CartesianOrientations, ScaleTypes } from '@/interfaces/enums'\nimport { ThresholdOptions } from '@/interfaces/components'\n\nexport type ScaleFunction =\n\t| ScaleTime<number, number, never>\n\t| ScaleBand<string>\n\t| ScaleLinear<number, number, never>\n\nexport class CartesianScales extends Service {\n\tprotected scaleTypes = {\n\t\ttop: null as ScaleTypes,\n\t\tright: null as ScaleTypes,\n\t\tbottom: null as ScaleTypes,\n\t\tleft: null as ScaleTypes\n\t}\n\n\tprotected scales = {\n\t\t// null or function\n\t\ttop: null as ScaleLinear<number, number, never>,\n\t\tright: null as ScaleLinear<number, number, never>,\n\t\tbottom: null as ScaleLinear<number, number, never>,\n\t\tleft: null as ScaleLinear<number, number, never>\n\t}\n\n\tprotected domainAxisPosition: AxisPositions\n\tprotected rangeAxisPosition: AxisPositions\n\tprotected secondaryDomainAxisPosition: AxisPositions\n\tprotected secondaryRangeAxisPosition: AxisPositions\n\n\tprotected dualAxes: boolean\n\n\tprotected orientation: CartesianOrientations\n\n\tgetDomainAxisPosition({ datum = null }: { datum?: any } = {}) {\n\t\tif (this.dualAxes && datum) {\n\t\t\tconst options = this.model.getOptions()\n\t\t\tconst { groupMapsTo } = options.data\n\t\t\tconst axesOptions = getProperty(options, 'axes', this.secondaryDomainAxisPosition)\n\t\t\tconst dataset = datum[groupMapsTo]\n\t\t\tif (\n\t\t\t\taxesOptions?.correspondingDatasets &&\n\t\t\t\taxesOptions.correspondingDatasets.includes(dataset)\n\t\t\t) {\n\t\t\t\treturn this.secondaryDomainAxisPosition\n\t\t\t}\n\t\t}\n\t\treturn this.domainAxisPosition\n\t}\n\n\tgetRangeAxisPosition({ datum = null, groups = null }: { datum?: any; groups?: any } = {}) {\n\t\tif (this.dualAxes) {\n\t\t\tconst options = this.model.getOptions()\n\t\t\tconst { groupMapsTo } = options.data\n\t\t\tconst axisOptions = getProperty(options, 'axes', this.secondaryRangeAxisPosition)\n\t\t\tlet dataset\n\t\t\tif (datum !== null) {\n\t\t\t\tdataset = datum[groupMapsTo]\n\t\t\t} else if (groups && groups.length > 0) {\n\t\t\t\tdataset = groups[0]\n\t\t\t}\n\t\t\tif (\n\t\t\t\taxisOptions?.correspondingDatasets &&\n\t\t\t\taxisOptions.correspondingDatasets.includes(dataset)\n\t\t\t) {\n\t\t\t\treturn this.secondaryRangeAxisPosition\n\t\t\t}\n\t\t}\n\t\treturn this.rangeAxisPosition\n\t}\n\n\tgetAxisOptions(position: AxisPositions) {\n\t\treturn getProperty(this.model.getOptions(), 'axes', position)\n\t}\n\n\tgetDomainAxisOptions() {\n\t\tconst domainAxisPosition = this.getDomainAxisPosition()\n\t\treturn this.getAxisOptions(domainAxisPosition)\n\t}\n\n\tgetRangeAxisOptions() {\n\t\tconst rangeAxisPosition = this.getRangeAxisPosition()\n\t\treturn this.getAxisOptions(rangeAxisPosition)\n\t}\n\n\tgetScaleLabel(position: AxisPositions) {\n\t\tconst axisOptions = this.getAxisOptions(position)\n\t\tconst title: string = axisOptions.title\n\t\tif (!title) {\n\t\t\tif (position === AxisPositions.BOTTOM || position === AxisPositions.TOP) {\n\t\t\t\treturn 'x-value'\n\t\t\t}\n\t\t\treturn 'y-value'\n\t\t}\n\t\treturn title\n\t}\n\n\tgetDomainLabel() {\n\t\treturn this.getScaleLabel(this.getDomainAxisPosition())\n\t}\n\n\tgetRangeLabel() {\n\t\treturn this.getScaleLabel(this.getRangeAxisPosition())\n\t}\n\n\tupdate() {\n\t\tthis.determineAxisDuality()\n\t\tthis.findDomainAndRangeAxes()\n\t\tthis.determineOrientation()\n\t\tconst axisPositions: AxisPositions[] = Object.keys(AxisPositions).map(\n\t\t\t(axisPositionKey: string) => AxisPositions[axisPositionKey as keyof typeof AxisPositions]\n\t\t)\n\t\taxisPositions.forEach(axisPosition => {\n\t\t\tthis.scales[axisPosition] = this.createScale(axisPosition) as ScaleLinear<\n\t\t\t\tnumber,\n\t\t\t\tnumber,\n\t\t\t\tnever\n\t\t\t>\n\t\t})\n\t}\n\n\tfindDomainAndRangeAxes() {\n\t\t// find main axes between (left & right) && (bottom & top)\n\t\tconst verticalAxesPositions = this.findVerticalAxesPositions()\n\t\tconst horizontalAxesPositions = this.findHorizontalAxesPositions()\n\n\t\t// Now we have horizontal & vertical main axes to choose domain & range axes from\n\t\tconst domainAndRangeAxesPositions = this.findDomainAndRangeAxesPositions(\n\t\t\tverticalAxesPositions,\n\t\t\thorizontalAxesPositions\n\t\t)\n\n\t\tthis.domainAxisPosition = domainAndRangeAxesPositions.primaryDomainAxisPosition\n\t\tthis.rangeAxisPosition = domainAndRangeAxesPositions.primaryRangeAxisPosition\n\n\t\tif (this.isDualAxes()) {\n\t\t\tthis.secondaryDomainAxisPosition = domainAndRangeAxesPositions.secondaryDomainAxisPosition\n\t\t\tthis.secondaryRangeAxisPosition = domainAndRangeAxesPositions.secondaryRangeAxisPosition\n\t\t}\n\t}\n\n\tdetermineOrientation() {\n\t\tif (\n\t\t\t(this.rangeAxisPosition === AxisPositions.LEFT ||\n\t\t\t\tthis.rangeAxisPosition === AxisPositions.RIGHT) &&\n\t\t\t(this.domainAxisPosition === AxisPositions.BOTTOM ||\n\t\t\t\tthis.domainAxisPosition === AxisPositions.TOP)\n\t\t) {\n\t\t\tthis.orientation = CartesianOrientations.VERTICAL\n\t\t} else {\n\t\t\tthis.orientation = CartesianOrientations.HORIZONTAL\n\t\t}\n\t}\n\n\tisDualAxes() {\n\t\treturn this.dualAxes\n\t}\n\n\t// if any of the axes objects have correspondingDatasets [] asserted we flag the chart as dual axes\n\t// it does not count as dual axes if it just has another axis turned on but is not actually using it to map a dataset\n\tdetermineAxisDuality() {\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\n\t\tif (\n\t\t\t(axesOptions[AxisPositions.LEFT]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.RIGHT]) ||\n\t\t\t(axesOptions[AxisPositions.RIGHT]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.LEFT]) ||\n\t\t\t(axesOptions[AxisPositions.TOP]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.BOTTOM]) ||\n\t\t\t(axesOptions[AxisPositions.BOTTOM]?.correspondingDatasets && axesOptions[AxisPositions.TOP])\n\t\t) {\n\t\t\tthis.dualAxes = true\n\t\t}\n\t}\n\n\tgetCustomDomainValuesByposition(axisPosition: AxisPositions) {\n\t\tconst domain = getProperty(this.model.getOptions(), 'axes', axisPosition, 'domain')\n\n\t\t// Check if domain is an array\n\t\tif (domain && !Array.isArray(domain)) {\n\t\t\tthrow new Error(`Domain in ${axisPosition} axis is not a valid array`)\n\t\t}\n\n\t\t// Determine number of elements passed in domain depending on scale types\n\t\tif (Array.isArray(domain)) {\n\t\t\tif (\n\t\t\t\t(this.scaleTypes[axisPosition] === ScaleTypes.LINEAR ||\n\t\t\t\t\tthis.scaleTypes[axisPosition] === ScaleTypes.TIME) &&\n\t\t\t\tdomain.length !== 2\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`There can only be 2 elements in domain for scale type: ${this.scaleTypes[axisPosition]}`\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\treturn domain\n\t}\n\n\tgetOrientation() {\n\t\treturn this.orientation\n\t}\n\n\tgetScaleByPosition(axisPosition: AxisPositions) {\n\t\treturn this.scales[axisPosition]\n\t}\n\n\tgetScaleTypeByPosition(axisPosition: AxisPositions) {\n\t\treturn this.scaleTypes[axisPosition]\n\t}\n\n\tgetDomainAxisScaleType() {\n\t\tconst domainAxisPosition = this.getDomainAxisPosition()\n\t\treturn this.getScaleTypeByPosition(domainAxisPosition)\n\t}\n\n\tgetRangeAxisScaleType() {\n\t\tconst rangeAxisPosition = this.getRangeAxisPosition()\n\t\treturn this.getScaleTypeByPosition(rangeAxisPosition)\n\t}\n\n\tgetDomainScale() {\n\t\treturn this.scales[this.domainAxisPosition]\n\t}\n\n\tgetRangeScale() {\n\t\treturn this.scales[this.rangeAxisPosition]\n\t}\n\n\t// Find the main x-axis out of the 2 x-axis on the chart (when 2D axis is used)\n\tgetMainXAxisPosition() {\n\t\tconst possibleXAxisPositions = [AxisPositions.BOTTOM, AxisPositions.TOP]\n\n\t\treturn [this.domainAxisPosition, this.rangeAxisPosition].find(\n\t\t\tposition => possibleXAxisPositions.indexOf(position) > -1\n\t\t)\n\t}\n\n\t// Find the main y-axis out of the 2 y-axis on the chart (when 2D axis is used)\n\tgetMainYAxisPosition() {\n\t\tconst possibleYAxisPositions = [AxisPositions.LEFT, AxisPositions.RIGHT]\n\n\t\treturn [this.domainAxisPosition, this.rangeAxisPosition].find(\n\t\t\tposition => possibleYAxisPositions.indexOf(position) > -1\n\t\t)\n\t}\n\n\tgetMainXScale() {\n\t\treturn this.scales[this.getMainXAxisPosition()]\n\t}\n\n\tgetMainYScale() {\n\t\treturn this.scales[this.getMainYAxisPosition()]\n\t}\n\n\tgetValueFromScale(scale: any, scaleType: ScaleTypes, axisPosition: AxisPositions, datum: any) {\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\t\tconst axisOptions = axesOptions[axisPosition]\n\t\tconst { mapsTo } = axisOptions\n\t\tconst value = getProperty(datum, mapsTo) !== null ? datum[mapsTo] : datum\n\t\tlet scaledValue: number\n\t\tswitch (scaleType) {\n\t\t\tcase ScaleTypes.LABELS:\n\t\t\t\tscaledValue = scale(value) + scale.step() / 2\n\t\t\t\tbreak\n\t\t\tcase ScaleTypes.TIME:\n\t\t\t\tscaledValue = scale(new Date(value))\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tscaledValue = scale(value)\n\t\t}\n\t\treturn scaledValue\n\t}\n\n\tgetBoundedScaledValues(datum: any): number[] {\n\t\tconst { bounds } = this.model.getOptions()\n\t\tconst axisPosition = this.getRangeAxisPosition({ datum })\n\t\tconst scale = this.scales[axisPosition]\n\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\t\tconst axisOptions = axesOptions[axisPosition]\n\t\tconst { mapsTo } = axisOptions\n\t\tconst value = datum[mapsTo] !== undefined ? datum[mapsTo] : datum\n\n\t\tconst boundedValues = [\n\t\t\tscale(\n\t\t\t\tgetProperty(datum, bounds.upperBoundMapsTo) !== null\n\t\t\t\t\t? datum[bounds.upperBoundMapsTo]\n\t\t\t\t\t: value\n\t\t\t),\n\t\t\tscale(\n\t\t\t\tgetProperty(datum, bounds.lowerBoundMapsTo) !== null\n\t\t\t\t\t? datum[bounds.lowerBoundMapsTo]\n\t\t\t\t\t: value\n\t\t\t)\n\t\t]\n\n\t\treturn boundedValues\n\t}\n\n\tgetValueThroughAxisPosition(axisPosition: AxisPositions, datum: any) {\n\t\tconst scaleType = this.scaleTypes[axisPosition] as ScaleTypes\n\t\tconst scale = this.scales[axisPosition]\n\n\t\treturn this.getValueFromScale(scale, scaleType, axisPosition, datum)\n\t}\n\n\tgetDomainValue(d: string | object) {\n\t\tconst axisPosition = this.getDomainAxisPosition({ datum: d })\n\t\treturn this.getValueThroughAxisPosition(axisPosition, d)\n\t}\n\n\tgetRangeValue(d: number | string | object) {\n\t\tconst axisPosition = this.getRangeAxisPosition({ datum: d })\n\t\treturn this.getValueThroughAxisPosition(axisPosition, d)\n\t}\n\n\tgetMainXScaleType() {\n\t\treturn this.getScaleTypeByPosition(this.getMainXAxisPosition())\n\t}\n\n\tgetMainYScaleType() {\n\t\treturn this.getScaleTypeByPosition(this.getMainYAxisPosition())\n\t}\n\n\tgetDomainIdentifier(datum?: any) {\n\t\tconst options = this.model.getOptions()\n\t\treturn getProperty(options, 'axes', this.getDomainAxisPosition({ datum: datum }), 'mapsTo')\n\t}\n\n\tgetRangeIdentifier(datum?: any) {\n\t\tconst options = this.model.getOptions()\n\t\treturn getProperty(options, 'axes', this.getRangeAxisPosition({ datum: datum }), 'mapsTo')\n\t}\n\n\textendsDomain(axisPosition: AxisPositions, domain: any) {\n\t\tconst options = this.model.getOptions()\n\t\tconst axisOptions = getProperty(options, 'axes', axisPosition)\n\t\tif (axisOptions.scaleType === ScaleTypes.TIME) {\n\t\t\tconst spaceToAddToEdges = getProperty(options, 'timeScale', 'addSpaceOnEdges')\n\t\t\treturn addSpacingToTimeDomain(domain, spaceToAddToEdges)\n\t\t} else {\n\t\t\treturn addSpacingToContinuousDomain(domain, axisConfigs.paddingRatio, axisOptions.scaleType)\n\t\t}\n\t}\n\n\tprotected findVerticalAxesPositions() {\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\t\tconst dualAxes = this.isDualAxes()\n\n\t\t// If right axis has been specified as `main`\n\t\tif (\n\t\t\t(getProperty(axesOptions, AxisPositions.LEFT) === null &&\n\t\t\t\tgetProperty(axesOptions, AxisPositions.RIGHT) !== null) ||\n\t\t\tgetProperty(axesOptions, AxisPositions.RIGHT, 'main') === true ||\n\t\t\t(dualAxes && getProperty(axesOptions, AxisPositions.LEFT, 'correspondingDatasets'))\n\t\t) {\n\t\t\treturn {\n\t\t\t\tprimary: AxisPositions.RIGHT,\n\t\t\t\tsecondary: AxisPositions.LEFT\n\t\t\t}\n\t\t}\n\n\t\treturn { primary: AxisPositions.LEFT, secondary: AxisPositions.RIGHT }\n\t}\n\n\tprotected findHorizontalAxesPositions() {\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\t\tconst dualAxes = this.isDualAxes()\n\n\t\t// If top axis has been specified as `main`\n\t\tif (\n\t\t\t(getProperty(axesOptions, AxisPositions.BOTTOM) === null &&\n\t\t\t\tgetProperty(axesOptions, AxisPositions.TOP) !== null) ||\n\t\t\tgetProperty(axesOptions, AxisPositions.TOP, 'main') === true ||\n\t\t\t(dualAxes && getProperty(axesOptions, AxisPositions.BOTTOM, 'correspondingDatasets'))\n\t\t) {\n\t\t\treturn {\n\t\t\t\tprimary: AxisPositions.TOP,\n\t\t\t\tsecondary: AxisPositions.BOTTOM\n\t\t\t}\n\t\t}\n\n\t\treturn { primary: AxisPositions.BOTTOM, secondary: AxisPositions.TOP }\n\t}\n\n\tprotected findDomainAndRangeAxesPositions(\n\t\tverticalAxesPositions: any,\n\t\thorizontalAxesPositions: any\n\t) {\n\t\tconst options = this.model.getOptions()\n\n\t\tconst mainVerticalAxisOptions = getProperty(options, 'axes', verticalAxesPositions.primary)\n\t\tconst mainHorizontalAxisOptions = getProperty(options, 'axes', horizontalAxesPositions.primary)\n\n\t\tconst mainVerticalScaleType = mainVerticalAxisOptions.scaleType || ScaleTypes.LINEAR\n\t\tconst mainHorizontalScaleType = mainHorizontalAxisOptions.scaleType || ScaleTypes.LINEAR\n\n\t\tconst result = {\n\t\t\tprimaryDomainAxisPosition: null as AxisPositions,\n\t\t\tsecondaryDomainAxisPosition: null as AxisPositions,\n\t\t\tprimaryRangeAxisPosition: null as AxisPositions,\n\t\t\tsecondaryRangeAxisPosition: null as AxisPositions\n\t\t}\n\n\t\t// assign to to be a vertical chart by default\n\t\tresult.primaryDomainAxisPosition = horizontalAxesPositions.primary\n\t\tresult.primaryRangeAxisPosition = verticalAxesPositions.primary\n\t\t// secondary axes\n\t\tresult.secondaryDomainAxisPosition = horizontalAxesPositions.secondary\n\t\tresult.secondaryRangeAxisPosition = verticalAxesPositions.secondary\n\n\t\t// if neither the horizontal axes are label or time\n\t\t// and atleast one of the main vertical ones are labels or time then it should be horizontal\n\t\tif (\n\t\t\t(!(\n\t\t\t\tmainHorizontalScaleType === ScaleTypes.LABELS || mainHorizontalScaleType === ScaleTypes.TIME\n\t\t\t) &&\n\t\t\t\tmainVerticalScaleType === ScaleTypes.LABELS) ||\n\t\t\tmainVerticalScaleType === ScaleTypes.TIME\n\t\t) {\n\t\t\tresult.primaryDomainAxisPosition = verticalAxesPositions.primary\n\t\t\tresult.primaryRangeAxisPosition = horizontalAxesPositions.primary\n\t\t\t// secondary axes\n\t\t\tresult.secondaryDomainAxisPosition = verticalAxesPositions.secondary\n\t\t\tresult.secondaryRangeAxisPosition = horizontalAxesPositions.secondary\n\t\t}\n\n\t\treturn result\n\t}\n\n\tgetScaleDomain(axisPosition: AxisPositions) {\n\t\tconst options = this.model.getOptions()\n\t\tconst axisOptions = getProperty(options, 'axes', axisPosition)\n\t\tconst bounds = getProperty(options, 'bounds')\n\t\tconst { includeZero } = axisOptions\n\t\tconst scaleType = getProperty(axisOptions, 'scaleType') || ScaleTypes.LINEAR\n\n\t\tif (this.model.isDataEmpty()) {\n\t\t\treturn []\n\t\t}\n\n\t\tif (axisOptions.binned) {\n\t\t\tconst { bins } = this.model.getBinConfigurations()\n\n\t\t\treturn [0, max(bins, (d: any) => d.length)]\n\t\t} else if (axisOptions.limitDomainToBins) {\n\t\t\tconst { bins } = this.model.getBinConfigurations()\n\t\t\tconst stackKeys = this.model.getStackKeys({ bins })\n\n\t\t\treturn [stackKeys[0].split(':')[0], stackKeys[stackKeys.length - 1].split(':')[1]]\n\t\t}\n\n\t\tconst displayData = this.model.getDisplayData()\n\t\tconst { extendLinearDomainBy, mapsTo, percentage, thresholds } = axisOptions\n\t\tconst { reference: ratioReference, compareTo: ratioCompareTo } = axisConfigs.ratio\n\n\t\t// If domain is specified return that domain\n\t\tif (axisOptions.domain) {\n\t\t\tif (scaleType === ScaleTypes.LABELS) {\n\t\t\t\treturn axisOptions.domain\n\t\t\t} else if (scaleType === ScaleTypes.TIME) {\n\t\t\t\taxisOptions.domain = axisOptions.domain.map((d: any) =>\n\t\t\t\t\td.getTime === undefined ? new Date(d) : d\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn this.extendsDomain(axisPosition, axisOptions.domain)\n\t\t}\n\n\t\t// Return [0, 100] for percentage axis scale\n\t\tif (percentage) {\n\t\t\treturn [0, 100]\n\t\t}\n\n\t\t// If scale is a LABELS scale, return some labels as the domain\n\t\tif (axisOptions && scaleType === ScaleTypes.LABELS) {\n\t\t\t// Get unique values\n\t\t\treturn uniq(displayData.map((d: any) => d[mapsTo]))\n\t\t}\n\n\t\t// Get the extent of the domain\n\t\tlet domain: any\n\t\tlet allDataValues: any\n\t\tconst dataGroupNames = this.model.getDataGroupNames()\n\n\t\tif (scaleType === ScaleTypes.LABELS_RATIO) {\n\t\t\treturn displayData.map((datum: any) => `${datum[ratioReference]}/${datum[ratioCompareTo]}`)\n\t\t} else if (scaleType === ScaleTypes.TIME) {\n\t\t\tallDataValues = displayData.map((datum: any) => +new Date(datum[mapsTo]))\n\t\t} else if (bounds && options.axes) {\n\t\t\tallDataValues = []\n\n\t\t\tdisplayData.forEach((datum: any) => {\n\t\t\t\tallDataValues.push(datum[mapsTo])\n\n\t\t\t\tif (datum[bounds.upperBoundMapsTo]) {\n\t\t\t\t\tallDataValues.push(datum[bounds.upperBoundMapsTo])\n\t\t\t\t}\n\t\t\t\tif (datum[bounds.lowerBoundMapsTo]) {\n\t\t\t\t\tallDataValues.push(datum[bounds.lowerBoundMapsTo])\n\t\t\t\t}\n\t\t\t})\n\t\t} else if (\n\t\t\taxisOptions.stacked === true &&\n\t\t\tdataGroupNames &&\n\t\t\taxisPosition === this.getRangeAxisPosition()\n\t\t) {\n\t\t\tconst { groupMapsTo } = options.data\n\t\t\tconst dataValuesGroupedByKeys = this.model.getDataValuesGroupedByKeys({\n\t\t\t\tgroups: dataGroupNames\n\t\t\t})\n\t\t\tconst nonStackedGroupsData = displayData.filter(\n\t\t\t\t(datum: any) => !dataGroupNames.includes(datum[groupMapsTo])\n\t\t\t)\n\n\t\t\tconst stackedValues: any[] = []\n\t\t\tdataValuesGroupedByKeys.forEach((dataValues: any) => {\n\t\t\t\tconst { ...numericalValues } = dataValues\n\n\t\t\t\tlet positiveSum = 0,\n\t\t\t\t\tnegativeSum = 0\n\t\t\t\tObject.values(numericalValues).forEach((value: number) => {\n\t\t\t\t\tif (!isNaN(value)) {\n\t\t\t\t\t\tif (value < 0) {\n\t\t\t\t\t\t\tnegativeSum += value\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpositiveSum += value\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tstackedValues.push([negativeSum, positiveSum])\n\t\t\t})\n\n\t\t\tallDataValues = [\n\t\t\t\t...flatten(stackedValues),\n\t\t\t\t...nonStackedGroupsData.map((datum: any) => datum[mapsTo])\n\t\t\t]\n\t\t} else {\n\t\t\tallDataValues = []\n\n\t\t\tdisplayData.forEach((datum: any) => {\n\t\t\t\tconst value = datum[mapsTo]\n\t\t\t\tif (Array.isArray(value) && value.length === 2) {\n\t\t\t\t\tallDataValues.push(value[0])\n\t\t\t\t\tallDataValues.push(value[1])\n\t\t\t\t} else {\n\t\t\t\t\tif (extendLinearDomainBy) {\n\t\t\t\t\t\tallDataValues.push(Math.max(datum[mapsTo], datum[extendLinearDomainBy]))\n\t\t\t\t\t}\n\t\t\t\t\tallDataValues.push(value)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\t// Time can never be 0 and log of base 0 is -Infinity\n\t\tif (scaleType !== ScaleTypes.TIME && scaleType !== ScaleTypes.LOG && includeZero) {\n\t\t\tallDataValues.push(0)\n\t\t}\n\n\t\t// Add threshold values into the scale\n\t\tif (thresholds && thresholds.length > 0) {\n\t\t\tthresholds.forEach((threshold: any) => {\n\t\t\t\tconst thresholdValue = getProperty(threshold, 'value')\n\t\t\t\tif (thresholdValue !== null) allDataValues.push(thresholdValue)\n\t\t\t})\n\t\t}\n\n\t\tdomain = extent(allDataValues)\n\t\tdomain = this.extendsDomain(axisPosition, domain)\n\n\t\treturn domain\n\t}\n\n\tprotected createScale(axisPosition: AxisPositions) {\n\t\tconst options = this.model.getOptions()\n\t\tconst axisOptions = getProperty(options, 'axes', axisPosition)\n\n\t\tif (!axisOptions) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst scaleType = getProperty(axisOptions, 'scaleType') || ScaleTypes.LINEAR\n\t\tthis.scaleTypes[axisPosition] = scaleType\n\n\t\tlet scale: ScaleFunction\n\t\tif (scaleType === ScaleTypes.TIME) {\n\t\t\tscale = scaleTime()\n\t\t} else if (scaleType === ScaleTypes.LOG) {\n\t\t\tscale = scaleLog().base(axisOptions.base || 10)\n\t\t} else if (scaleType === ScaleTypes.LABELS || scaleType === ScaleTypes.LABELS_RATIO) {\n\t\t\tscale = scaleBand()\n\t\t} else {\n\t\t\tscale = scaleLinear()\n\t\t}\n\n\t\tscale.domain(this.getScaleDomain(axisPosition))\n\n\t\treturn scale\n\t}\n\n\tgetHighestDomainThreshold(): null | {\n\t\tthreshold: ThresholdOptions\n\t\tscaleValue: number\n\t} {\n\t\tconst axesOptions = getProperty(this.model.getOptions(), 'axes')\n\t\tconst domainAxisPosition = this.getDomainAxisPosition()\n\n\t\tconst { thresholds } = axesOptions[domainAxisPosition]\n\n\t\t// Check if thresholds exist & is not empty\n\t\tif (!Array.isArray(thresholds) || (Array.isArray(thresholds) && !thresholds.length)) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst domainScale = this.getDomainScale()\n\t\t// Find the highest threshold for the domain\n\t\tconst highestThreshold = thresholds.sort((a, b) => b.value - a.value)[0]\n\n\t\tconst scaleType = this.getScaleTypeByPosition(domainAxisPosition)\n\t\tif (\n\t\t\tscaleType === ScaleTypes.TIME &&\n\t\t\t(typeof highestThreshold.value === 'string' || highestThreshold.value.getTime === undefined)\n\t\t) {\n\t\t\thighestThreshold.value = new Date(highestThreshold.value)\n\t\t}\n\n\t\treturn {\n\t\t\tthreshold: highestThreshold,\n\t\t\tscaleValue: domainScale(highestThreshold.value)\n\t\t}\n\t}\n\n\tgetHighestRangeThreshold(): null | {\n\t\tthreshold: ThresholdOptions\n\t\tscaleValue: number\n\t} {\n\t\tconst axesOptions = getProperty(this.model.getOptions(), 'axes')\n\t\tconst rangeAxisPosition = this.getRangeAxisPosition()\n\n\t\tconst { thresholds } = axesOptions[rangeAxisPosition]\n\n\t\t// Check if thresholds exist & is not empty\n\t\tif (!Array.isArray(thresholds) || (Array.isArray(thresholds) && !thresholds.length)) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst rangeScale = this.getRangeScale()\n\t\t// Find the highest threshold for the range\n\t\tconst highestThreshold = thresholds.sort((a, b) => b.value - a.value)[0]\n\n\t\treturn {\n\t\t\tthreshold: highestThreshold,\n\t\t\tscaleValue: rangeScale(highestThreshold.value)\n\t\t}\n\t}\n}\n\nfunction addSpacingToTimeDomain(domain: any, spaceToAddToEdges: number) {\n\tconst startDate = new Date(domain[0])\n\tconst endDate = new Date(domain[1])\n\n\tif (differenceInYears(endDate, startDate) > 1) {\n\t\treturn [subYears(startDate, spaceToAddToEdges), addYears(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInMonths(endDate, startDate) > 1) {\n\t\treturn [subMonths(startDate, spaceToAddToEdges), addMonths(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInDays(endDate, startDate) > 1) {\n\t\treturn [subDays(startDate, spaceToAddToEdges), addDays(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInHours(endDate, startDate) > 1) {\n\t\treturn [subHours(startDate, spaceToAddToEdges), addHours(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInMinutes(endDate, startDate) > 30) {\n\t\treturn [\n\t\t\tsubMinutes(startDate, spaceToAddToEdges * 30),\n\t\t\taddMinutes(endDate, spaceToAddToEdges * 30)\n\t\t]\n\t}\n\n\tif (differenceInMinutes(endDate, startDate) > 1) {\n\t\treturn [subMinutes(startDate, spaceToAddToEdges), addMinutes(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInSeconds(endDate, startDate) > 15) {\n\t\treturn [\n\t\t\tsubSeconds(startDate, spaceToAddToEdges * 15),\n\t\t\taddSeconds(endDate, spaceToAddToEdges * 15)\n\t\t]\n\t}\n\n\tif (differenceInSeconds(endDate, startDate) > 1) {\n\t\treturn [subSeconds(startDate, spaceToAddToEdges), addSeconds(endDate, spaceToAddToEdges)]\n\t}\n\n\treturn [startDate, endDate]\n}\n\nfunction addSpacingToContinuousDomain(\n\t[lower, upper]: number[],\n\tpaddingRatio: number,\n\tscaleType?: ScaleTypes\n) {\n\tconst domainLength = upper - lower\n\tconst padding = domainLength * paddingRatio\n\n\t// If padding crosses 0, keep 0 as new upper bound\n\tconst newUpper = upper <= 0 && upper + padding > 0 ? 0 : upper + padding\n\t// If padding crosses 0, keep 0 as new lower bound\n\tlet newLower = lower >= 0 && lower - padding < 0 ? 0 : lower - padding\n\n\t// Log of base 0 or a negative number is -Infinity\n\tif (scaleType === ScaleTypes.LOG && newLower <= 0) {\n\t\tif (lower <= 0) {\n\t\t\tthrow Error('Data must have values greater than 0 if log scale type is used.')\n\t\t}\n\t\tnewLower = lower\n\t}\n\n\treturn [newLower, newUpper]\n}\n","import {\n\tcurveBasis,\n\tcurveBasisClosed,\n\tcurveBasisOpen,\n\tcurveBundle,\n\tcurveCardinal,\n\tcurveCardinalClosed,\n\tcurveCardinalOpen,\n\tcurveCatmullRom,\n\tcurveCatmullRomClosed,\n\tcurveCatmullRomOpen,\n\tcurveLinear,\n\tcurveLinearClosed,\n\tcurveMonotoneX,\n\tcurveMonotoneY,\n\tcurveNatural,\n\tcurveStep,\n\tcurveStepAfter,\n\tcurveStepBefore\n} from 'd3'\nimport { Service } from './service'\n\nexport class Curves extends Service {\n\tcurveTypes = {\n\t\tcurveLinear,\n\t\tcurveLinearClosed,\n\t\tcurveBasis,\n\t\tcurveBasisClosed,\n\t\tcurveBasisOpen,\n\t\tcurveBundle,\n\t\tcurveCardinal,\n\t\tcurveCardinalClosed,\n\t\tcurveCardinalOpen,\n\t\tcurveCatmullRom,\n\t\tcurveCatmullRomClosed,\n\t\tcurveCatmullRomOpen,\n\t\tcurveMonotoneX,\n\t\tcurveMonotoneY,\n\t\tcurveNatural,\n\t\tcurveStep,\n\t\tcurveStepAfter,\n\t\tcurveStepBefore\n\t}\n\n\tgetD3Curve() {\n\t\tlet curveName = 'curveLinear' as keyof typeof this.curveTypes\n\t\tconst curveOptions = this.model.getOptions().curve\n\n\t\t// Parse curve type whether the user provided a string\n\t\t// Or an object with more options\n\t\tif (curveOptions) {\n\t\t\tif (typeof curveOptions === 'string') {\n\t\t\t\t// curve: 'string'\n\t\t\t\tcurveName = curveOptions as keyof typeof this.curveTypes\n\t\t\t} else {\n\t\t\t\t// curve: { name: 'string' }\n\t\t\t\tcurveName = curveOptions.name\n\t\t\t}\n\t\t}\n\n\t\tif (this.curveTypes[curveName]) {\n\t\t\t// Grab correct d3 curve function\n\t\t\tlet curve = this.curveTypes[curveName] as any\n\n\t\t\t// Apply user-provided options to the d3 curve\n\t\t\tif (curveOptions) {\n\t\t\t\tObject.keys(curveOptions).forEach(optionName => {\n\t\t\t\t\tif (curve[optionName]) {\n\t\t\t\t\t\tcurve = curve[optionName](curveOptions[optionName])\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\n\t\t\treturn curve\n\t\t}\n\n\t\tconsole.warn(`The curve type '${curveName}' is invalid, using 'curveLinear' instead`)\n\t\treturn this.curveTypes['curveLinear']\n\t}\n}\n","import { extent } from 'd3'\nimport { getProperty } from '@/tools'\nimport { zoomBar as zoomBarConfigs } from '@/configuration'\nimport { AxisPositions, Events, ScaleTypes } from '@/interfaces/enums'\nimport { Service } from './service'\n\nimport type { ChartModelCartesian } from '../model'\n\nexport class Zoom extends Service {\n\tprotected model: ChartModelCartesian\n\n\tisZoomBarEnabled() {\n\t\t// CartesianScales service is only available in axis charts\n\t\tif (!this.services.cartesianScales) {\n\t\t\treturn false\n\t\t}\n\n\t\t// @todo - need to update this if zoom bar in other position (bottom, left, right) is supported\n\t\t// check configuration\n\t\tif (!getProperty(this.model.getOptions(), 'zoomBar', 'top', 'enabled')) {\n\t\t\treturn false\n\t\t}\n\n\t\t// @todo - Zoom Bar only supports main axis at BOTTOM axis and time scale for now\n\t\tthis.services.cartesianScales.findDomainAndRangeAxes() // need to do this before getMainXAxisPosition()\n\t\tconst mainXAxisPosition = this.services.cartesianScales.getMainXAxisPosition()\n\t\tconst mainXScaleType = getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'axes',\n\t\t\tmainXAxisPosition,\n\t\t\t'scaleType'\n\t\t)\n\n\t\treturn mainXAxisPosition === AxisPositions.BOTTOM && mainXScaleType === ScaleTypes.TIME\n\t}\n\n\t// get display data for zoom bar\n\t// basically it's sum of value grouped by time\n\tgetZoomBarData() {\n\t\tconst customZoomBarData = this.model.getZoomBarData()\n\n\t\t// if user already defines zoom bar data, use it\n\t\tif (customZoomBarData && customZoomBarData.length > 1) {\n\t\t\treturn customZoomBarData\n\t\t} else {\n\t\t\t// use displayData if not defined\n\t\t\treturn this.model.getDisplayData()\n\t\t}\n\t}\n\n\tgetDefaultZoomBarDomain(zoomBarData?: any) {\n\t\tif (!this.services.zoom) throw new Error('Services zoom not defined')\n\t\tconst allZoomBarData = zoomBarData || this.services.zoom.getZoomBarData()\n\t\tconst { cartesianScales } = this.services\n\t\tif (!cartesianScales) throw new Error('Services cartesianScales undefined')\n\t\tconst mainXAxisPosition = cartesianScales.getMainXAxisPosition()\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier()\n\n\t\tconst customDomain = getProperty(this.model.getOptions(), 'axes', mainXAxisPosition, 'domain')\n\n\t\t// return custom domain if exists && valid\n\t\tif (Array.isArray(customDomain) && customDomain.length === 2) {\n\t\t\treturn customDomain\n\t\t}\n\n\t\t// default to full range with extended domain\n\t\tif (!mainXAxisPosition) throw new Error('Not defined: mainXAxisPosition')\n\t\treturn cartesianScales.extendsDomain(\n\t\t\tmainXAxisPosition,\n\t\t\textent(allZoomBarData, (d: any) => d[domainIdentifier])\n\t\t)\n\t}\n\n\thandleDomainChange(newDomain: any, configs = { dispatchEvent: true }) {\n\t\tthis.model.set({ zoomDomain: newDomain }, { animate: false })\n\t\tif (configs.dispatchEvent) {\n\t\t\tthis.services.events?.dispatchEvent(Events.ZoomDomain.CHANGE, {\n\t\t\t\tnewDomain\n\t\t\t})\n\t\t}\n\t}\n\n\tgetZoomRatio() {\n\t\treturn getProperty(this.model.getOptions(), 'zoomBar', 'zoomRatio')\n\t}\n\n\t// filter out data not inside zoom domain\n\t// to get better range value for axis label\n\tfilterDataForRangeAxis(displayData: object[], configs?: any) {\n\t\tconst zoomDomain = this.model.get('zoomDomain')\n\t\tconst mergedConfigs = Object.assign(\n\t\t\t{ stacked: false }, // default configs\n\t\t\tconfigs\n\t\t)\n\t\tconst shouldUpdateRangeAxis = getProperty(this.model.getOptions(), 'zoomBar', 'updateRangeAxis')\n\t\tif (this.isZoomBarEnabled() && shouldUpdateRangeAxis && zoomDomain) {\n\t\t\tconst domainIdentifier = mergedConfigs.stacked\n\t\t\t\t? 'sharedStackKey'\n\t\t\t\t: this.services.cartesianScales?.getDomainIdentifier()\n\t\t\tconst filteredData = displayData.filter(\n\t\t\t\t(datum: any) =>\n\t\t\t\t\tnew Date(datum[domainIdentifier]) >= zoomDomain[0] &&\n\t\t\t\t\tnew Date(datum[domainIdentifier]) <= zoomDomain[1]\n\t\t\t)\n\t\t\t// if no data in zoom domain, use all data to get full range value\n\t\t\t// so only return filteredData if length > 0\n\t\t\tif (filteredData.length > 0) {\n\t\t\t\treturn filteredData\n\t\t\t}\n\t\t}\n\t\t// return original data by default\n\t\treturn displayData\n\t}\n\n\tzoomIn(zoomRatio = this.getZoomRatio()) {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\t\tconst handleWidth = zoomBarConfigs.handleWidth\n\t\tconst xScale = this.services.cartesianScales?.getMainXScale().copy()\n\t\txScale.domain(this.getDefaultZoomBarDomain()) // reset domain to default full domain\n\n\t\t// use scale range (rather than domain) to calculate\n\t\t// current zoom bar handle x position\n\t\tconst currentX0 = xScale(currentZoomDomain[0])\n\t\tconst currentX1 = xScale(currentZoomDomain[1])\n\n\t\t// zoom bar handles are already too close\n\t\tif (currentX1 - currentX0 < handleWidth + 1) {\n\t\t\treturn\n\t\t}\n\t\tconst fullRange = xScale.range()\n\t\tconst gap = currentX1 - currentX0\n\t\tconst diff = Math.min(((fullRange[1] - fullRange[0]) / 2) * (zoomRatio / 2), gap / 2)\n\n\t\t// new zoom bar handle x position\n\t\tlet newX0 = currentX0 + diff\n\t\tlet newX1 = currentX1 - diff\n\t\t// if left handle becomes right side of right handle, just make them close to each other\n\t\tif (newX0 >= newX1) {\n\t\t\tnewX0 = currentX0 + gap / 2 - handleWidth / 2\n\t\t\tnewX1 = currentX1 - gap / 2 + handleWidth / 2\n\t\t}\n\n\t\tconst newDomain = [xScale.invert(newX0), xScale.invert(newX1)]\n\n\t\t// only if zoomDomain needs update\n\t\tif (\n\t\t\tcurrentZoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\tcurrentZoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t) {\n\t\t\tthis.handleDomainChange(newDomain)\n\t\t}\n\t}\n\n\tzoomOut(zoomRatio = this.getZoomRatio()) {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\n\t\tif (!this.services.cartesianScales) throw new Error('Services cartesianScales undefined')\n\t\tconst xScale = this.services.cartesianScales.getMainXScale().copy()\n\n\t\txScale.domain(this.getDefaultZoomBarDomain()) // reset domain to default full domain\n\n\t\t// use scale range (rather than domain) to calculate\n\t\t// current zoom bar handle x position\n\t\tconst currentX0 = xScale(currentZoomDomain[0])\n\t\tconst currentX1 = xScale(currentZoomDomain[1])\n\n\t\tconst fullRange = xScale.range()\n\t\tconst diff = ((fullRange[1] - fullRange[0]) / 2) * (zoomRatio / 2)\n\n\t\t// new zoom bar handle x position\n\t\t// max to full range\n\t\tconst newX0 = Math.max(currentX0 - diff, fullRange[0])\n\t\tconst newX1 = Math.min(currentX1 + diff, fullRange[1])\n\n\t\tconst newDomain = [xScale.invert(newX0), xScale.invert(newX1)]\n\n\t\t// only if zoomDomain needs update\n\t\tif (\n\t\t\tcurrentZoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\tcurrentZoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t) {\n\t\t\tthis.handleDomainChange(newDomain)\n\t\t}\n\t}\n\n\tresetZoomDomain() {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\t\tconst newDomain = this.getDefaultZoomBarDomain()\n\n\t\t// only if zoomDomain needs update\n\t\tif (\n\t\t\tcurrentZoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\tcurrentZoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t) {\n\t\t\tthis.handleDomainChange(newDomain)\n\t\t}\n\t}\n\n\t// check if current zoom domain is already the min zoom domain\n\t// when toolbar is rendered, we don't render chart yet\n\t// don't depend on scale range\n\tisMinZoomDomain() {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\t\t// assume the max zoom domain is the default zoom bar domain\n\t\tconst maxZoomDomain = this.getDefaultZoomBarDomain()\n\t\tif (!currentZoomDomain || !maxZoomDomain) {\n\t\t\treturn false\n\t\t}\n\n\t\tconst currentZoomDomainPeriod = currentZoomDomain[1].valueOf() - currentZoomDomain[0].valueOf()\n\t\tconst maxZoomDomainPeriod = maxZoomDomain[1].valueOf() - maxZoomDomain[0].valueOf()\n\t\tconst minZoomRatio = getProperty(this.model.getOptions(), 'zoomBar', 'minZoomRatio')\n\t\t// if current zoom domain is already smaller than minZoomRatio\n\t\tif (currentZoomDomainPeriod / maxZoomDomainPeriod < minZoomRatio) {\n\t\t\treturn true\n\t\t}\n\n\t\treturn false\n\t}\n\n\t// check if current zoom domain is already the max zoom domain\n\tisMaxZoomDomain() {\n\t\t// get current zoom domain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\t\t// assume the max zoom domain is the default zoom bar domain\n\t\tconst maxZoomDomain = this.getDefaultZoomBarDomain()\n\n\t\tif (\n\t\t\tcurrentZoomDomain &&\n\t\t\tmaxZoomDomain &&\n\t\t\tcurrentZoomDomain[0].valueOf() === maxZoomDomain[0].valueOf() &&\n\t\t\tcurrentZoomDomain[1].valueOf() === maxZoomDomain[1].valueOf()\n\t\t) {\n\t\t\treturn true\n\t\t}\n\n\t\treturn false\n\t}\n\n\tisEmptyState() {\n\t\treturn this.getZoomBarData().length === 0\n\t}\n\n\tisZoomBarLoading(position: any) {\n\t\treturn getProperty(this.model.getOptions(), 'zoomBar', position, 'loading')\n\t}\n\n\tisZoomBarLocked(position: any) {\n\t\treturn getProperty(this.model.getOptions(), 'zoomBar', position, 'locked')\n\t}\n}\n","import { Chart } from './chart'\nimport { getProperty } from './tools'\nimport { ChartModelCartesian } from '@/model/cartesian-charts'\nimport { AxisChartOptions } from '@/interfaces/charts'\nimport { ChartConfig } from '@/interfaces/model'\nimport {\n\tAxisPositions,\n\tLayoutAlignItems,\n\tLayoutDirection,\n\tLayoutGrowth,\n\tLegendOrientations,\n\tLegendPositions,\n\tRenderTypes,\n\tScaleTypes\n} from '@/interfaces/enums'\nimport { ChartBrush } from '@/components/axes/grid-brush'\nimport { ChartClip } from '@/components/axes/chart-clip'\nimport { Toolbar } from '@/components/axes/toolbar'\nimport { ZoomBar } from '@/components/axes/zoom-bar'\nimport { LayoutComponent } from '@/components/layout'\nimport { Spacer } from '@/components/layout/spacer'\nimport { Modal } from '@/components/essentials/modal'\nimport { Legend } from '@/components/essentials/legend'\nimport { Threshold } from '@/components/essentials/threshold'\nimport { Highlight } from '@/components/essentials/highlights'\nimport { Title } from '@/components/essentials/title'\nimport { AxisChartsTooltip } from '@/components/essentials/tooltip-axis'\nimport { CartesianScales } from '@/services/scales-cartesian'\nimport { Curves } from '@/services/curves'\nimport { Zoom } from '@/services/zoom'\n\nexport class AxisChart extends Chart {\n\tservices: any = Object.assign(this.services, {\n\t\tcartesianScales: CartesianScales,\n\t\tcurves: Curves,\n\t\tzoom: Zoom\n\t})\n\tmodel: ChartModelCartesian = new ChartModelCartesian(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<AxisChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\t}\n\n\tprotected getAxisChartComponents(graphFrameComponents: any[], configs?: any) {\n\t\tconst options = this.model.getOptions()\n\t\tconst isZoomBarEnabled = getProperty(options, 'zoomBar', AxisPositions.TOP, 'enabled')\n\t\tconst toolbarEnabled = getProperty(options, 'toolbar', 'enabled')\n\n\t\tthis.services.cartesianScales.determineAxisDuality()\n\t\tthis.services.cartesianScales.findDomainAndRangeAxes() // need to do this before getMainXAxisPosition()\n\t\tthis.services.cartesianScales.determineOrientation()\n\n\t\tconst mainXAxisPosition = this.services.cartesianScales.getMainXAxisPosition()\n\t\tconst mainXScaleType = getProperty(options, 'axes', mainXAxisPosition, 'scaleType')\n\t\t// @todo - Zoom Bar only supports main axis at BOTTOM axis and time scale for now\n\t\tconst zoomBarEnabled =\n\t\t\tisZoomBarEnabled &&\n\t\t\tmainXAxisPosition === AxisPositions.BOTTOM &&\n\t\t\tmainXScaleType === ScaleTypes.TIME\n\n\t\t// @todo - should check if zoom bar in all axes are locked\n\t\tconst isZoomBarLocked = this.services.zoom.isZoomBarLocked(AxisPositions.TOP)\n\n\t\tconst titleAvailable = !!this.model.getOptions().title\n\t\tconst titleComponent = {\n\t\t\tid: 'title',\n\t\t\tcomponents: [new Title(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.STRETCH\n\t\t}\n\n\t\tconst toolbarComponent = {\n\t\t\tid: 'toolbar',\n\t\t\tcomponents: [new Toolbar(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst headerComponent = {\n\t\t\tid: 'header',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t// always add title to keep layout correct\n\t\t\t\t\t\ttitleComponent,\n\t\t\t\t\t\t...(toolbarEnabled ? [toolbarComponent] : [])\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: LayoutDirection.ROW,\n\t\t\t\t\t\talignItems: LayoutAlignItems.CENTER\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst legendComponent = {\n\t\t\tid: 'legend',\n\t\t\tcomponents: [new Legend(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\t// if all zoom bars are locked, no need to add chart brush\n\t\tif (zoomBarEnabled && !isZoomBarLocked) {\n\t\t\tgraphFrameComponents.push(\n\t\t\t\tnew ChartClip(this.model, this.services),\n\t\t\t\tnew ChartBrush(this.model, this.services)\n\t\t\t)\n\t\t}\n\n\t\tgraphFrameComponents.push(new Threshold(this.model, this.services))\n\t\tgraphFrameComponents.push(new Highlight(this.model, this.services))\n\n\t\tconst graphFrameComponent = {\n\t\t\tid: 'graph-frame',\n\t\t\tcomponents: graphFrameComponents,\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t\trenderType: RenderTypes.SVG\n\t\t}\n\n\t\tconst isLegendEnabled =\n\t\t\tgetProperty(configs, 'legend', 'enabled') !== false &&\n\t\t\tthis.model.getOptions().legend.enabled !== false\n\n\t\t// Decide the position of the legend in reference to the chart\n\t\tlet fullFrameComponentDirection = LayoutDirection.COLUMN\n\t\tif (isLegendEnabled) {\n\t\t\tconst legendPosition = getProperty(this.model.getOptions(), 'legend', 'position')\n\t\t\tif (legendPosition === LegendPositions.LEFT) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW\n\n\t\t\t\tif (!this.model.getOptions().legend.orientation) {\n\t\t\t\t\tthis.model.getOptions().legend.orientation = LegendOrientations.VERTICAL\n\t\t\t\t}\n\t\t\t} else if (legendPosition === LegendPositions.RIGHT) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW_REVERSE\n\n\t\t\t\tif (!this.model.getOptions().legend.orientation) {\n\t\t\t\t\tthis.model.getOptions().legend.orientation = LegendOrientations.VERTICAL\n\t\t\t\t}\n\t\t\t} else if (legendPosition === LegendPositions.BOTTOM) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.COLUMN_REVERSE\n\t\t\t}\n\t\t}\n\n\t\tconst legendSpacerComponent = {\n\t\t\tid: 'spacer',\n\t\t\tcomponents: [new Spacer(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst fullFrameComponent = {\n\t\t\tid: 'full-frame',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t...(isLegendEnabled ? [legendComponent] : []),\n\t\t\t\t\t\t...(isLegendEnabled ? [legendSpacerComponent] : []),\n\t\t\t\t\t\tgraphFrameComponent\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: fullFrameComponentDirection\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.STRETCH\n\t\t}\n\n\t\tconst zoomBarComponent = {\n\t\t\tid: 'zoom-bar',\n\t\t\tcomponents: [new ZoomBar(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t\trenderType: RenderTypes.SVG\n\t\t}\n\n\t\tconst topLevelLayoutComponents = []\n\t\t// header component is required for either title or toolbar\n\t\tif (titleAvailable || toolbarEnabled) {\n\t\t\ttopLevelLayoutComponents.push(headerComponent)\n\n\t\t\tconst titleSpacerComponent = {\n\t\t\t\tid: 'spacer',\n\t\t\t\tcomponents: [\n\t\t\t\t\tnew Spacer(this.model, this.services, toolbarEnabled ? { size: 15 } : undefined)\n\t\t\t\t],\n\t\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t\t}\n\n\t\t\ttopLevelLayoutComponents.push(titleSpacerComponent)\n\t\t}\n\t\tif (zoomBarEnabled) {\n\t\t\ttopLevelLayoutComponents.push(zoomBarComponent)\n\t\t}\n\t\ttopLevelLayoutComponents.push(fullFrameComponent)\n\n\t\treturn [\n\t\t\tnew AxisChartsTooltip(this.model, this.services),\n\t\t\tnew Modal(this.model, this.services),\n\t\t\tnew LayoutComponent(this.model, this.services, topLevelLayoutComponents, {\n\t\t\t\tdirection: LayoutDirection.COLUMN\n\t\t\t})\n\t\t]\n\t}\n}\n","import { axisBottom, axisLeft } from 'd3'\nimport { getProperty, getTranslationValues } from '@/tools'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { RenderTypes } from '@/interfaces/enums'\n\nexport class Grid extends Component {\n\ttype = 'grid'\n\trenderType = RenderTypes.SVG\n\n\tbackdrop: any\n\n\trender(animate = true) {\n\t\tconst isXGridEnabled = getProperty(this.getOptions(), 'grid', 'x', 'enabled')\n\t\tconst isYGridEnabled = getProperty(this.getOptions(), 'grid', 'y', 'enabled')\n\n\t\t// Draw the backdrop\n\t\tthis.drawBackdrop(isXGridEnabled, isYGridEnabled)\n\n\t\tif (!isXGridEnabled && !isYGridEnabled) {\n\t\t\treturn\n\t\t}\n\n\t\tif (isXGridEnabled) {\n\t\t\tDOMUtils.appendOrSelect(this.backdrop, 'g.x.grid')\n\t\t\tthis.drawXGrid(animate)\n\t\t}\n\n\t\tif (isYGridEnabled) {\n\t\t\tDOMUtils.appendOrSelect(this.backdrop, 'g.y.grid')\n\t\t\tthis.drawYGrid(animate)\n\t\t}\n\t}\n\n\tdrawXGrid(animate: boolean) {\n\t\tconst svg = this.parent\n\n\t\tconst height = this.backdrop.attr('height')\n\n\t\tconst mainXScale = this.services.cartesianScales.getMainXScale()\n\t\tconst xGrid = axisBottom(mainXScale as any)\n\t\t\t.tickSizeInner(-height)\n\t\t\t.tickSizeOuter(0)\n\n\t\t// if the main range axis has a custom domain, align the gridlines to the ticks\n\t\tconst alignToTicks = getProperty(this.getOptions(), 'grid', 'x', 'alignWithAxisTicks')\n\n\t\tif (alignToTicks) {\n\t\t\tconst mainXPosition = this.services.cartesianScales.getDomainAxisPosition()\n\t\t\tconst customDomain = getProperty(this.getOptions(), 'axes', mainXPosition, 'ticks', 'values')\n\t\t\t// use custom domain if there is one\n\t\t\t// otherwise d3 defaults to using one gridline per tick\n\t\t\tif (customDomain) {\n\t\t\t\txGrid.tickValues(customDomain)\n\t\t\t}\n\t\t} else {\n\t\t\t// Determine number of ticks\n\t\t\tconst numberOfTicks = getProperty(this.getOptions(), 'grid', 'x', 'numberOfTicks')\n\n\t\t\txGrid.ticks(numberOfTicks)\n\t\t}\n\n\t\tconst g = svg\n\t\t\t.select('.x.grid')\n\t\t\t.attr('transform', `translate(${-this.backdrop.attr('x')}, ${height})`)\n\n\t\tif (animate) {\n\t\t\tg.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'grid-update',\n\t\t\t\t\t\tanimate\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.call(xGrid as any)\n\t\t} else {\n\t\t\tg.call(xGrid as any)\n\t\t}\n\n\t\tthis.cleanGrid(g)\n\t}\n\n\tdrawYGrid(animate: boolean) {\n\t\tconst svg = this.parent\n\t\tconst width = this.backdrop.attr('width')\n\n\t\tconst mainYScale = this.services.cartesianScales.getMainYScale()\n\t\tconst yGrid = axisLeft(mainYScale as any)\n\t\t\t.tickSizeInner(-width)\n\t\t\t.tickSizeOuter(0)\n\n\t\t// if the main range axis has a custom domain, align the gridlines to the ticks\n\t\tconst alignToTicks = getProperty(this.getOptions(), 'grid', 'y', 'alignWithAxisTicks')\n\n\t\tif (alignToTicks) {\n\t\t\tconst mainYPosition = this.services.cartesianScales.getRangeAxisPosition()\n\n\t\t\tconst customDomain = getProperty(this.getOptions(), 'axes', mainYPosition, 'ticks', 'values')\n\n\t\t\t// use custom domain if there is one\n\t\t\t// otherwise d3 defaults to using one gridline per tick\n\t\t\tif (customDomain) {\n\t\t\t\tyGrid.tickValues(customDomain)\n\t\t\t}\n\t\t} else {\n\t\t\t// Determine number of ticks\n\t\t\tconst numberOfTicks = getProperty(this.getOptions(), 'grid', 'y', 'numberOfTicks')\n\n\t\t\tyGrid.ticks(numberOfTicks)\n\t\t}\n\n\t\tconst g = svg.select('.y.grid').attr('transform', `translate(0, ${-this.backdrop.attr('y')})`)\n\n\t\tif (animate) {\n\t\t\tg.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'grid-update',\n\t\t\t\t\t\tanimate\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.call(yGrid as any)\n\t\t} else {\n\t\t\tg.call(yGrid as any)\n\t\t}\n\n\t\tthis.cleanGrid(g)\n\t}\n\n\t/**\n\t * Returns the threshold for the gridline tooltips based on the mouse location.\n\t * Calculated based on the mouse position between the two closest gridlines or edges of chart.\n\t */\n\tgetGridlineThreshold(mousePos: any) {\n\t\t// use the space between axis grid ticks to adjust the threshold for the tooltips\n\t\tconst svg = this.parent\n\n\t\t// sort in ascending x translation value order\n\t\tconst gridlinesX = svg\n\t\t\t.selectAll('.x.grid .tick')\n\t\t\t.nodes()\n\t\t\t.sort((a: HTMLElement, b: HTMLElement) => {\n\t\t\t\treturn Number(getTranslationValues(a).tx) - Number(getTranslationValues(b).tx)\n\t\t\t})\n\n\t\t// find the 2 gridlines on either side of the mouse\n\t\tlet floor = -1\n\t\tif (!gridlinesX.length) {\n\t\t\treturn\n\t\t}\n\n\t\tgridlinesX.forEach((line: HTMLElement) => {\n\t\t\tif (mousePos[0] >= +getTranslationValues(line).tx) {\n\t\t\t\tfloor++\n\t\t\t}\n\t\t})\n\t\tconst ceiling = floor + 1 < gridlinesX.length ? floor + 1 : gridlinesX.length\n\n\t\t// get the 'step' between chart gridlines\n\t\tconst line1 = gridlinesX[floor]\n\t\tconst line2 = gridlinesX[ceiling]\n\t\tlet lineSpacing\n\n\t\t// if the mouse is on edge of charts (mouseX < first gridline || mouseX > last gridline)\n\t\t// we can use the chart edge to determind the threshold for the gridlines\n\t\tif (!line1) {\n\t\t\t// we are between the first gridline and the chart edge\n\t\t\tlineSpacing = +getTranslationValues(line2 as any).tx\n\t\t} else if (!line2) {\n\t\t\t// we need to use the chart right bounds in case there isnt a domain axis\n\t\t\tconst gridElement = svg.select('rect.chart-grid-backdrop').node()\n\t\t\tconst width = DOMUtils.getSVGElementSize(gridElement as any).width\n\n\t\t\tlineSpacing = width - +getTranslationValues(line1 as any).tx\n\t\t} else {\n\t\t\t// there are two gridlines to use\n\t\t\tlineSpacing = +getTranslationValues(line2 as any).tx - +getTranslationValues(line1 as any).tx\n\t\t}\n\t\tconst { threshold } = this.getOptions().tooltip.gridline\n\t\t// return the threshold\n\t\treturn lineSpacing * threshold\n\t}\n\n\t/**\n\t * Returns the active gridlines based on the gridline threshold and mouse position.\n\t * @param position mouse positon\n\t */\n\tgetActiveGridline(position: any) {\n\t\tconst userSpecifiedThreshold = getProperty(this.getOptions, 'tooltip', 'gridline', 'threshold')\n\t\tconst threshold = userSpecifiedThreshold\n\t\t\t? userSpecifiedThreshold\n\t\t\t: this.getGridlineThreshold(position)\n\t\tconst svg = this.parent\n\n\t\tconst xGridlines = svg.selectAll('.x.grid .tick').filter(function () {\n\t\t\tconst translations = getTranslationValues(this as any)\n\n\t\t\t// threshold for when to display a gridline tooltip\n\t\t\tconst bounds = {\n\t\t\t\tmin: Number(translations.tx) - threshold,\n\t\t\t\tmax: Number(translations.tx) + threshold\n\t\t\t}\n\n\t\t\treturn bounds.min <= position[0] && position[0] <= bounds.max\n\t\t})\n\n\t\treturn xGridlines\n\t}\n\n\tdrawBackdrop(isXGridEnabled: boolean, isYGridEnabled: boolean) {\n\t\tconst svg = this.parent\n\n\t\tconst mainXScale = this.services.cartesianScales.getMainXScale()\n\t\tconst mainYScale = this.services.cartesianScales.getMainYScale()\n\n\t\tconst [xScaleStart, xScaleEnd] = mainXScale.range()\n\t\tconst [yScaleEnd, yScaleStart] = mainYScale.range()\n\n\t\t// Get height from the grid\n\t\tthis.backdrop = DOMUtils.appendOrSelect(svg, 'svg.chart-grid-backdrop')\n\t\tconst backdropRect = DOMUtils.appendOrSelect(\n\t\t\tthis.backdrop,\n\t\t\tisXGridEnabled || isYGridEnabled\n\t\t\t\t? 'rect.chart-grid-backdrop.stroked'\n\t\t\t\t: 'rect.chart-grid-backdrop'\n\t\t)\n\n\t\tthis.backdrop\n\t\t\t.merge(backdropRect)\n\t\t\t.attr('x', xScaleStart)\n\t\t\t.attr('y', yScaleStart)\n\t\t\t.attr('width', Math.abs(xScaleEnd - xScaleStart))\n\t\t\t.attr('height', Math.abs(yScaleEnd - yScaleStart))\n\t\t\t.lower()\n\n\t\tbackdropRect.attr('width', '100%').attr('height', '100%')\n\t}\n\n\tcleanGrid(g: any) {\n\t\t// Remove extra elements\n\t\tg.selectAll('text').remove()\n\t\tg.select('.domain').remove()\n\t}\n}\n","import { area, select } from 'd3'\nimport { getProperty } from '@/tools'\nimport { area as areaConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport { CartesianOrientations, Events, ColorClassNameTypes, RenderTypes } from '@/interfaces/enums'\nimport { GradientUtils } from '@/services/essentials/gradient-utils'\n\nexport class Area extends Component {\n\ttype = 'area'\n\trenderType = RenderTypes.SVG\n\n\tgradient_id = 'gradient-id-' + Math.floor(Math.random() * 99999999999)\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events\n\n\t\t// Highlight correct area on legend item hovers\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\n\t\t// Un-highlight area on legend item mouseouts\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true })\n\t\tconst options = this.getOptions()\n\t\tlet domain = [0, 0]\n\n\t\tconst { cartesianScales } = this.services\n\n\t\tconst orientation = cartesianScales.getOrientation()\n\t\tconst areaGenerator = area()\n\t\t\t.curve(this.services.curves.getD3Curve())\n\t\t\t.defined((datum: any) => {\n\t\t\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier()\n\t\t\t\tconst value = datum[rangeIdentifier]\n\t\t\t\tif (value === null || value === undefined) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\treturn true\n\t\t\t})\n\n\t\t// Update the bound data on area groups\n\t\tconst groupedData = this.model.getGroupedData(this.configs.groups)\n\n\t\tconst bounds = getProperty(options, 'bounds')\n\t\tconst boundsEnabled = bounds && groupedData && groupedData.length === 1\n\n\t\tif (!boundsEnabled && bounds) {\n\t\t\tconsole.warn(\n\t\t\t\t`Bounds can only be shown when having 1 single datagroup, you've supplied ${groupedData.length}`\n\t\t\t) // eslint-disable-line no-console\n\t\t}\n\n\t\tlet upperBoundRangeValue = 0\n\t\t// If includeZero is enabled, we want to replace upperBoundRange from 0 to domain value\n\t\tconst includeZeroInRangeValue = (position: any, _domain: any) => {\n\t\t\tif (getProperty(options, 'axes', position, 'includeZero') === false) {\n\t\t\t\t// Replace upperBoundRangeValue if domain is positive\n\t\t\t\tif (_domain[0] > 0 && _domain[1] > 0) {\n\t\t\t\t\tupperBoundRangeValue = _domain[0]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst upperBound = (d: any) =>\n\t\t\tboundsEnabled\n\t\t\t\t? cartesianScales.getBoundedScaledValues(d)[0]\n\t\t\t\t: cartesianScales.getRangeValue(upperBoundRangeValue)\n\n\t\tconst lowerBound = (d: any) =>\n\t\t\tboundsEnabled\n\t\t\t\t? cartesianScales.getBoundedScaledValues(d)[1]\n\t\t\t\t: cartesianScales.getRangeValue(d)\n\n\t\tif (orientation === CartesianOrientations.VERTICAL) {\n\t\t\tdomain = cartesianScales.getMainYScale().domain() as number[]\n\t\t\tincludeZeroInRangeValue(cartesianScales.getMainYAxisPosition(), domain)\n\n\t\t\tareaGenerator\n\t\t\t\t.x((d: any) => cartesianScales.getDomainValue(d))\n\t\t\t\t.y0((d: any) => upperBound(d))\n\t\t\t\t.y1((d: any) => lowerBound(d))\n\t\t} else {\n\t\t\tdomain = cartesianScales.getMainXScale().domain() as number[]\n\t\t\tincludeZeroInRangeValue(cartesianScales.getMainXAxisPosition(), domain)\n\n\t\t\tareaGenerator\n\t\t\t\t.x0((d: any) => upperBound(d))\n\t\t\t\t.x1((d: any) => lowerBound(d))\n\t\t\t\t.y((d: any) => cartesianScales.getDomainValue(d))\n\t\t}\n\n\t\t// Is gradient enabled or not\n\t\tconst isGradientEnabled = getProperty(options, 'color', 'gradient', 'enabled')\n\n\t\t// Should gradient style be applicable\n\t\tconst isGradientAllowed = groupedData && groupedData.length === 1 && isGradientEnabled\n\n\t\tif (groupedData.length > 1 && isGradientEnabled) {\n\t\t\tconsole.error('Gradients can only be enabled when having 1 single dataset')\n\t\t}\n\n\t\tconst areas = svg.selectAll('path.area').data(groupedData, (group: any) => group.name)\n\n\t\tconst chartMainContainer = select(this.services.domUtils.getMainContainer())\n\n\t\t// Remove elements that need to be exited\n\t\t// We need exit at the top here to make sure that\n\t\t// Data filters are processed before entering new elements\n\t\t// Or updating existing ones\n\t\tareas.exit().attr('opacity', 0).remove()\n\n\t\t// if there is no grouped data (if all data groups are turned OFF with legend which can happen in the case of combo charts)\n\t\tif (!groupedData.length) {\n\t\t\treturn\n\t\t}\n\n\t\tif (isGradientAllowed) {\n\t\t\t// The fill value of area has been overwritten, get color value from stroke color class instead\n\t\t\tconst strokePathElement = chartMainContainer\n\t\t\t\t.select(\n\t\t\t\t\t`path.${this.model.getColorClassName({\n\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\t\tdataGroupName: groupedData[0].name\n\t\t\t\t\t})}`\n\t\t\t\t)\n\t\t\t\t.node()\n\n\t\t\tlet colorValue\n\t\t\tif (strokePathElement) {\n\t\t\t\tcolorValue = getComputedStyle(strokePathElement as HTMLElement, null).getPropertyValue(\n\t\t\t\t\t'stroke'\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\tconst sparklineColorObject = getProperty(this.model.getOptions(), 'color', 'scale')\n\n\t\t\t\tif (sparklineColorObject !== null) {\n\t\t\t\t\tconst sparklineColorObjectKeys = Object.keys(sparklineColorObject)\n\t\t\t\t\tcolorValue = sparklineColorObject[sparklineColorObjectKeys[0]]\n\t\t\t\t}\n\t\t\t}\n\t\t\tGradientUtils.appendOrUpdateLinearGradient({\n\t\t\t\tsvg: this.parent,\n\t\t\t\tid: this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`${groupedData[0].name.replace(' ', '')}_${this.gradient_id}`\n\t\t\t\t),\n\t\t\t\tx1: '0%',\n\t\t\t\tx2: '0%',\n\t\t\t\ty1: '0%',\n\t\t\t\ty2: '100%',\n\t\t\t\tstops: GradientUtils.getStops(domain, colorValue)\n\t\t\t})\n\t\t} else {\n\t\t\t// make sure there is no linearGradient if no gradient is allowed\n\t\t\tif (!this.parent.selectAll('defs linearGradient').empty()) {\n\t\t\t\tthis.parent.selectAll('defs linearGradient').each(function () {\n\t\t\t\t\t;(this as any).parentNode.remove()\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\tconst self = this\n\n\t\t// Enter paths that need to be introduced\n\t\tconst enteringAreas = areas.enter().append('path')\n\t\tif (isGradientAllowed) {\n\t\t\tenteringAreas\n\t\t\t\t.merge(areas as any)\n\t\t\t\t.style(\n\t\t\t\t\t'fill',\n\t\t\t\t\t(group: any) =>\n\t\t\t\t\t\t`url(#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t\t\t`${group.name.replace(' ', '')}_${this.gradient_id}`\n\t\t\t\t\t\t)})`\n\t\t\t\t)\n\t\t\t\t.attr('class', 'area')\n\t\t\t\t.attr('class', (group: any) =>\n\t\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\t\tdataGroupName: group.name,\n\t\t\t\t\t\toriginalClassName: 'area'\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.attr('d', (group: any) => {\n\t\t\t\t\tconst { data } = group\n\t\t\t\t\treturn areaGenerator(data)\n\t\t\t\t})\n\t\t} else {\n\t\t\tenteringAreas\n\t\t\t\t.attr('opacity', 0)\n\t\t\t\t.merge(areas as any)\n\t\t\t\t.attr('class', 'area')\n\t\t\t\t.attr('class', (group: any) =>\n\t\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL, ColorClassNameTypes.STROKE],\n\t\t\t\t\t\tdataGroupName: group.name,\n\t\t\t\t\t\toriginalClassName: 'area'\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.style('fill', (group: any) => self.model.getFillColor(group.name))\n\t\t\t\t.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'area-update-enter',\n\t\t\t\t\t\tanimate\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.attr('opacity', boundsEnabled ? 1 : areaConfigs.opacity.selected)\n\t\t\t\t.attr('d', (group: any) => {\n\t\t\t\t\tconst { data } = group\n\t\t\t\t\treturn areaGenerator(data)\n\t\t\t\t})\n\n\t\t\tif (boundsEnabled) {\n\t\t\t\tenteringAreas\n\t\t\t\t\t.attr('fill-opacity', areaConfigs.opacity.selected)\n\t\t\t\t\t.style('stroke', (group: any) => self.model.getStrokeColor(group.name))\n\t\t\t\t\t.style('stroke-dasharray', '2, 2')\n\t\t\t\t\t.attr('stroke-width', 0.7 + 'px')\n\t\t\t}\n\t\t}\n\t}\n\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\n\t\tthis.parent\n\t\t\t.selectAll('path.area')\n\t\t\t.transition('legend-hover-area')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-area'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (group: any) => {\n\t\t\t\tif (group.name !== hoveredElement.datum()['name']) {\n\t\t\t\t\treturn areaConfigs.opacity.unselected\n\t\t\t\t}\n\n\t\t\t\treturn areaConfigs.opacity.selected\n\t\t\t})\n\t}\n\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('path.area')\n\t\t\t.transition('legend-mouseout-area')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-area'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', areaConfigs.opacity.selected)\n\t}\n\n\tdestroy() {\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n}\n","import { line } from 'd3'\nimport { some } from 'lodash-es'\nimport { flipDomainAndRangeBasedOnOrientation, getProperty } from '@/tools'\nimport { lines as lineConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport { Events, ColorClassNameTypes, RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\n\nexport class Line extends Component {\n\ttype = 'line'\n\trenderType = RenderTypes.SVG\n\n\tinit() {\n\t\tconst { events } = this.services\n\t\t// Highlight correct line legend item hovers\n\t\tevents.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\t// Un-highlight lines on legend item mouseouts\n\t\tevents.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true })\n\t\tconst { cartesianScales, curves } = this.services\n\n\t\tconst getDomainValue = (d: any) => cartesianScales.getDomainValue(d)\n\t\tconst getRangeValue = (d: any) => cartesianScales.getRangeValue(d)\n\t\tconst [getXValue, getYValue] = flipDomainAndRangeBasedOnOrientation(\n\t\t\tgetDomainValue,\n\t\t\tgetRangeValue,\n\t\t\tcartesianScales.getOrientation()\n\t\t)\n\t\tconst options = this.getOptions()\n\n\t\t// D3 line generator function\n\t\tconst lineGenerator = line()\n\t\t\t.x(getXValue)\n\t\t\t.y(getYValue)\n\t\t\t.curve(curves.getD3Curve())\n\t\t\t.defined((datum: any) => {\n\t\t\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier(datum)\n\t\t\t\tconst value = datum[rangeIdentifier]\n\t\t\t\tif (value === null || value === undefined) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\treturn true\n\t\t\t})\n\n\t\tlet data = []\n\t\tif (this.configs.stacked) {\n\t\t\tconst percentage = Object.keys(options.axes).some(axis => options.axes[axis].percentage)\n\t\t\tconst { groupMapsTo } = options.data\n\t\t\tconst stackedData = this.model.getStackedData({\n\t\t\t\tgroups: this.configs.groups,\n\t\t\t\tpercentage\n\t\t\t})\n\n\t\t\tdata = stackedData.map((d: any) => {\n\t\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(d)\n\t\t\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier(d)\n\t\t\t\treturn {\n\t\t\t\t\tname: getProperty(d, 0, groupMapsTo),\n\t\t\t\t\tdata: d.map((datum: any) => ({\n\t\t\t\t\t\t[domainIdentifier]: datum.data.sharedStackKey,\n\t\t\t\t\t\t[groupMapsTo]: datum[groupMapsTo],\n\t\t\t\t\t\t[rangeIdentifier]: datum[1]\n\t\t\t\t\t})),\n\t\t\t\t\thidden: !some(d, (datum: any) => datum[0] !== datum[1])\n\t\t\t\t}\n\t\t\t})\n\t\t} else {\n\t\t\tdata = this.model.getGroupedData(this.configs.groups)\n\t\t}\n\n\t\t// Update the bound data on lines\n\t\tconst lines = svg.selectAll('path.line').data(data, (group: any) => group.name)\n\n\t\t// Remove elements that need to be exited\n\t\t// We need exit at the top here to make sure that\n\t\t// Data filters are processed before entering new elements\n\t\t// Or updating existing ones\n\t\tlines.exit().attr('opacity', 0).remove()\n\n\t\t// Add lines that need to be introduced\n\t\tconst enteringLines = lines.enter().append('path').classed('line', true).attr('opacity', 0)\n\n\t\t// Apply styles and datum\n\t\tenteringLines\n\t\t\t.merge(lines as any)\n\t\t\t.data(data, (group: any) => group.name)\n\t\t\t.attr('class', (group: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\tdataGroupName: group.name,\n\t\t\t\t\toriginalClassName: 'line'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('stroke', (group: any) => this.model.getStrokeColor(group.name))\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'line')\n\t\t\t.attr('aria-label', (group: any) => {\n\t\t\t\tconst { data: groupData } = group\n\t\t\t\treturn groupData\n\t\t\t\t\t.map((datum: any) => {\n\t\t\t\t\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier(datum)\n\t\t\t\t\t\treturn datum[rangeIdentifier]\n\t\t\t\t\t})\n\t\t\t\t\t.join(',')\n\t\t\t})\n\t\t\t// Transition\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'line-update-enter',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => (d.hidden ? 0 : 1))\n\t\t\t.attr('d', (group: any) => {\n\t\t\t\tconst { data: groupData } = group\n\t\t\t\treturn lineGenerator(groupData)\n\t\t\t})\n\t}\n\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\n\t\tthis.parent\n\t\t\t.selectAll('path.line')\n\t\t\t.transition('legend-hover-line')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-line'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (group: any) => {\n\t\t\t\tif (group.name !== hoveredElement.datum()['name']) {\n\t\t\t\t\treturn lineConfigs.opacity.unselected\n\t\t\t\t}\n\n\t\t\t\treturn lineConfigs.opacity.selected\n\t\t\t})\n\t}\n\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('path.line')\n\t\t\t.transition('legend-mouseout-line')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-line'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', lineConfigs.opacity.selected)\n\t}\n\n\tdestroy() {\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n}\n","import { Selection, pointer } from 'd3'\nimport { isEqual } from 'lodash-es'\nimport { debounceWithD3MousePosition, getProperty } from '@/tools'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { CartesianOrientations, Events, RenderTypes } from '@/interfaces/enums'\n\nexport type GenericSvgSelection = Selection<SVGGraphicsElement, any, Element, any>\n\nconst THRESHOLD = 5\n\n/** check if x is inside threshold area extents */\nfunction pointIsWithinThreshold(dx: number, x: number) {\n\treturn dx > x - THRESHOLD && dx < x + THRESHOLD\n}\n\nexport class Ruler extends Component {\n\ttype = 'ruler'\n\trenderType = RenderTypes.SVG\n\n\tbackdrop: GenericSvgSelection\n\telementsToHighlight: GenericSvgSelection\n\tpointsWithinLine: {\n\t\tdomainValue: number\n\t\toriginalData: any\n\t}[]\n\tisXGridEnabled = getProperty(this.getOptions(), 'grid', 'x', 'enabled')\n\tisYGridEnabled = getProperty(this.getOptions(), 'grid', 'y', 'enabled')\n\t// flag for checking whether ruler event listener is added or not\n\tisEventListenerAdded = false\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = false) {\n\t\tconst isRulerEnabled = getProperty(this.getOptions(), 'ruler', 'enabled')\n\n\t\tthis.drawBackdrop()\n\n\t\tif (isRulerEnabled && !this.isEventListenerAdded) {\n\t\t\tthis.addBackdropEventListeners()\n\t\t} else if (!isRulerEnabled && this.isEventListenerAdded) {\n\t\t\tthis.removeBackdropEventListeners()\n\t\t}\n\t}\n\n\tremoveBackdropEventListeners() {\n\t\tthis.isEventListenerAdded = false\n\t\tthis.backdrop.on('mousemove mouseover mouseout', null)\n\t}\n\n\tformatTooltipData(tooltipData: any) {\n\t\treturn tooltipData\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tshowRuler(event: CustomEvent, [x, y]: [number, number]) {\n\t\tconst svg = this.parent\n\n\t\tconst orientation: CartesianOrientations = this.services.cartesianScales.getOrientation()\n\n\t\tconst displayData = this.model.getDisplayData()\n\n\t\tconst rangeScale = this.services.cartesianScales.getRangeScale()\n\t\tconst [yScaleEnd, yScaleStart] = rangeScale.range()\n\n\t\tconst mouseCoordinate = orientation === CartesianOrientations.HORIZONTAL ? y : x\n\t\tconst ruler = DOMUtils.appendOrSelect(svg, 'g.ruler').attr('aria-label', 'ruler')\n\t\tconst rulerLine = DOMUtils.appendOrSelect(ruler, 'line.ruler-line')\n\t\tconst dataPointElements: GenericSvgSelection = svg.selectAll('[role=graphics-symbol]')\n\n\t\tconst pointsWithinLine = displayData\n\t\t\t.map((d: any) => ({\n\t\t\t\tdomainValue: this.services.cartesianScales.getDomainValue(d) as number,\n\t\t\t\toriginalData: d\n\t\t\t}))\n\t\t\t.filter((d: any) => pointIsWithinThreshold(d.domainValue, mouseCoordinate))\n\n\t\tif (\n\t\t\tthis.pointsWithinLine &&\n\t\t\tpointsWithinLine.length === this.pointsWithinLine.length &&\n\t\t\tpointsWithinLine.map((point: any) => point.domainValue).join() ===\n\t\t\t\tthis.pointsWithinLine.map(point => point.domainValue).join()\n\t\t) {\n\t\t\tthis.pointsWithinLine = pointsWithinLine\n\t\t\treturn this.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\tmousePosition: [x, y]\n\t\t\t})\n\t\t}\n\n\t\tthis.pointsWithinLine = pointsWithinLine\n\n\t\t/**\n\t\t * Find matches, reduce is used instead of filter\n\t\t * to only get elements which belong to the same axis coordinate\n\t\t */\n\t\tconst dataPointsMatchingRulerLine: {\n\t\t\tdomainValue: number\n\t\t\toriginalData: any\n\t\t}[] = this.pointsWithinLine.reduce((accum, currentValue) => {\n\t\t\tif (accum.length === 0) {\n\t\t\t\taccum.push(currentValue)\n\t\t\t\treturn accum\n\t\t\t}\n\n\t\t\t// store the first element of the accumulator array to compare it with current element being processed\n\t\t\tconst sampleAccumValue = accum[0].domainValue\n\n\t\t\tconst distanceToCurrentValue = Math.abs(mouseCoordinate - currentValue.domainValue)\n\t\t\tconst distanceToAccumValue = Math.abs(mouseCoordinate - sampleAccumValue)\n\n\t\t\tif (distanceToCurrentValue > distanceToAccumValue) {\n\t\t\t\t// if distance with current value is bigger than already existing value in the accumulator, skip current iteration\n\t\t\t\treturn accum\n\t\t\t} else if (distanceToCurrentValue < distanceToAccumValue) {\n\t\t\t\t// currentValue data point is closer to mouse inside the threshold area, so reinstantiate array\n\t\t\t\taccum = [currentValue]\n\t\t\t} else {\n\t\t\t\t// currentValue is equal to already stored values, which means there's another match on the same coordinate\n\t\t\t\taccum.push(currentValue)\n\t\t\t}\n\n\t\t\treturn accum\n\t\t}, [])\n\n\t\t// some data point match\n\t\tif (dataPointsMatchingRulerLine.length > 0) {\n\t\t\tconst tooltipData = dataPointsMatchingRulerLine\n\t\t\t\t.map((d: any) => d.originalData)\n\t\t\t\t.filter((d: any) => {\n\t\t\t\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier(d)\n\t\t\t\t\tconst value = d[rangeIdentifier]\n\t\t\t\t\treturn value !== null && value !== undefined\n\t\t\t\t})\n\n\t\t\t// get elements on which we should trigger mouse events\n\t\t\tconst domainValuesMatchingRulerLine = dataPointsMatchingRulerLine.map(\n\t\t\t\t(d: any) => d.domainValue\n\t\t\t)\n\t\t\tconst elementsToHighlight = dataPointElements.filter((d: any) => {\n\t\t\t\tconst domainValue = this.services.cartesianScales.getDomainValue(d) as number\n\t\t\t\treturn domainValuesMatchingRulerLine.includes(domainValue)\n\t\t\t})\n\n\t\t\t/** if we pass from a trigger area to another one\n\t\t\t * mouseout on previous elements won't get dispatched\n\t\t\t * so we need to do it manually\n\t\t\t */\n\t\t\tif (\n\t\t\t\tthis.elementsToHighlight &&\n\t\t\t\tthis.elementsToHighlight.size() > 0 &&\n\t\t\t\t!isEqual(this.elementsToHighlight, elementsToHighlight)\n\t\t\t) {\n\t\t\t\tthis.hideRuler()\n\t\t\t}\n\n\t\t\telementsToHighlight.dispatch('mouseover')\n\n\t\t\t// set current hovered elements\n\t\t\tthis.elementsToHighlight = elementsToHighlight\n\n\t\t\tthis.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\tmousePosition: [x, y],\n\t\t\t\thoveredElement: rulerLine,\n\t\t\t\tdata: this.formatTooltipData(tooltipData)\n\t\t\t})\n\n\t\t\truler.attr('opacity', 1)\n\n\t\t\t// line snaps to matching point\n\t\t\tconst sampleMatch = dataPointsMatchingRulerLine[0]\n\t\t\tif (orientation === 'horizontal') {\n\t\t\t\trulerLine\n\t\t\t\t\t.attr('x1', yScaleStart)\n\t\t\t\t\t.attr('x2', yScaleEnd)\n\t\t\t\t\t.attr('y1', sampleMatch.domainValue)\n\t\t\t\t\t.attr('y2', sampleMatch.domainValue)\n\t\t\t} else {\n\t\t\t\trulerLine\n\t\t\t\t\t.attr('y1', yScaleStart)\n\t\t\t\t\t.attr('y2', yScaleEnd)\n\t\t\t\t\t.attr('x1', sampleMatch.domainValue)\n\t\t\t\t\t.attr('x2', sampleMatch.domainValue)\n\t\t\t}\n\t\t} else {\n\t\t\tthis.hideRuler()\n\t\t}\n\t}\n\n\thideRuler() {\n\t\tconst svg = this.parent\n\t\tconst ruler = DOMUtils.appendOrSelect(svg, 'g.ruler')\n\t\tconst dataPointElements = svg.selectAll('[role=graphics-symbol]')\n\n\t\tdataPointElements.dispatch('mouseout')\n\t\tthis.services.events.dispatchEvent(Events.Tooltip.HIDE)\n\t\truler.attr('opacity', 0)\n\t}\n\n\t/**\n\t * Adds the listener on the X grid to trigger multiple point tooltips along the x axis.\n\t */\n\taddBackdropEventListeners() {\n\t\tthis.isEventListenerAdded = true\n\n\t\tconst self = this\n\n\t\tconst holder = this.services.domUtils.getHolder()\n\n\t\tconst displayData = this.model.getDisplayData()\n\n\t\tlet mouseMoveCallback = function (event: CustomEvent) {\n\t\t\tconst pos = pointer(event, self.parent.node())\n\n\t\t\tself.showRuler(event, pos)\n\t\t}\n\n\t\t// Debounce mouseMoveCallback if there are more than 100 datapoints\n\t\tif (displayData.length > 100) {\n\t\t\tconst debounceThreshold = (displayData.length % 50) * 12.5\n\n\t\t\tmouseMoveCallback = debounceWithD3MousePosition(\n\t\t\t\tfunction (event: CustomEvent) {\n\t\t\t\t\tconst { mousePosition } = this\n\t\t\t\t\tself.showRuler(event, mousePosition)\n\t\t\t\t},\n\t\t\t\tdebounceThreshold,\n\t\t\t\tholder\n\t\t\t)\n\t\t}\n\n\t\tthis.backdrop\n\t\t\t.on('mousemove mouseover', mouseMoveCallback)\n\t\t\t.on('mouseout', this.hideRuler.bind(this))\n\t}\n\n\tdrawBackdrop() {\n\t\tconst svg = this.parent\n\n\t\t// Get height from the grid\n\t\tthis.backdrop = DOMUtils.appendOrSelect(svg, 'svg.chart-grid-backdrop')\n\t}\n}\n","import { select, Selection } from 'd3'\nimport { flipDomainAndRangeBasedOnOrientation, getProperty } from '@/tools'\nimport { Component } from '@/components/component'\nimport { Events, ColorClassNameTypes, RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\n\nexport class Scatter extends Component {\n\ttype = 'scatter'\n\trenderType = RenderTypes.SVG\n\n\tscatterData: any\n\n\tinit() {\n\t\tconst { events } = this.services\n\t\tif (!events) throw new Error('Services events are undefined.')\n\n\t\t// Highlight correct circle on legend item hovers\n\t\tevents.addEventListener(\n\t\t\tEvents.Legend.ITEM_HOVER,\n\t\t\tthis.handleLegendOnHover as EventListenerOrEventListenerObject\n\t\t)\n\t\t// Un-highlight circles on legend item mouseouts\n\t\tevents.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\n\t\tconst { fadeInOnChartHolderMouseover } = this.configs\n\t\tif (fadeInOnChartHolderMouseover) {\n\t\t\t// Fade-in scatter circles\n\t\t\tevents.addEventListener(Events.Chart.MOUSEOVER, this.handleChartHolderOnHover)\n\t\t\t// Fade-out scatter circles\n\t\t\tevents.addEventListener(Events.Chart.MOUSEOUT, this.handleChartHolderOnMouseOut)\n\t\t}\n\t}\n\n\tfilterBasedOnZoomDomain(data: any) {\n\t\tconst { cartesianScales } = this.services\n\t\tif (!cartesianScales) throw new Error('Services cartesianScales are undefined.')\n\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier(data)\n\t\tconst zoomDomain = this.model.get('zoomDomain')\n\t\tif (zoomDomain !== undefined) {\n\t\t\treturn data.filter(\n\t\t\t\t(d: any) =>\n\t\t\t\t\td[domainIdentifier].getTime() >= zoomDomain[0].getTime() &&\n\t\t\t\t\td[domainIdentifier].getTime() <= zoomDomain[1].getTime()\n\t\t\t)\n\t\t}\n\t\treturn data\n\t}\n\n\tgetScatterData() {\n\t\tconst options = this.getOptions()\n\n\t\tconst { stacked } = this.configs\n\n\t\tlet scatterData\n\t\tif (stacked) {\n\t\t\tconst percentage = Object.keys(options.axes).some(axis => options.axes[axis].percentage)\n\t\t\tscatterData = this.model.getStackedData({\n\t\t\t\tgroups: this.configs.groups,\n\t\t\t\tpercentage\n\t\t\t})\n\t\t} else {\n\t\t\tconst { cartesianScales } = this.services\n\t\t\tif (!cartesianScales) throw new Error('Services cartesianScales are undefined.')\n\t\t\tscatterData = this.model.getDisplayData(this.configs.groups).filter((d: any) => {\n\t\t\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier(d)\n\t\t\t\treturn d[rangeIdentifier] !== undefined && d[rangeIdentifier] !== null\n\t\t\t})\n\t\t}\n\n\t\t// filter out datapoints that aren't part of the zoomed domain\n\t\treturn this.filterBasedOnZoomDomain(scatterData)\n\t}\n\n\trender(animate: boolean) {\n\t\tconst isScatterEnabled =\n\t\t\tgetProperty(this.getOptions(), 'points', 'enabled') ||\n\t\t\tgetProperty(this.getOptions(), 'bubble', 'enabled')\n\n\t\tif (!isScatterEnabled) {\n\t\t\treturn\n\t\t}\n\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true })\n\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst { cartesianScales } = this.services\n\t\tif (!cartesianScales) throw new Error('Services cartesianScales are undefined.')\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier()\n\n\t\t// Update data on dot groups\n\t\tconst circles = svg\n\t\t\t.selectAll('circle.dot')\n\t\t\t.data(\n\t\t\t\tthis.getScatterData(),\n\t\t\t\t(datum: any) => `${datum[groupMapsTo]}-${datum[domainIdentifier]}`\n\t\t\t) as Selection<SVGCircleElement, any, HTMLElement, any>\n\n\t\t// Remove circles that need to be removed\n\t\tcircles.exit().attr('opacity', 0).remove()\n\n\t\t// Add the dot groups that need to be introduced\n\t\tconst enteringCircles = circles.enter().append('circle').classed('dot', true).attr('opacity', 0)\n\n\t\t// Apply styling & position\n\t\tconst circlesToStyle = enteringCircles.merge(circles)\n\t\tthis.styleCircles(circlesToStyle, animate)\n\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners()\n\t}\n\n\t// A value is an anomaly if is above all defined domain and range thresholds\n\tisDatapointThresholdAnomaly(datum: any) {\n\t\tconst { handleThresholds } = this.configs\n\t\tif (!handleThresholds) {\n\t\t\treturn false\n\t\t}\n\n\t\tconst { cartesianScales } = this.services\n\t\tif (!cartesianScales) throw new Error('Cartesian scales service is undefined')\n\n\t\tconst orientation = cartesianScales.getOrientation()\n\n\t\t// Get highest domain and range thresholds\n\t\tconst [xThreshold, yThreshold] = flipDomainAndRangeBasedOnOrientation(\n\t\t\tcartesianScales.getHighestDomainThreshold(),\n\t\t\tcartesianScales.getHighestRangeThreshold(),\n\t\t\torientation\n\t\t)\n\n\t\tconst [getXValue, getYValue] = flipDomainAndRangeBasedOnOrientation(\n\t\t\t(d: any) => cartesianScales.getDomainValue(d),\n\t\t\t(d: any) => cartesianScales.getRangeValue(d),\n\t\t\torientation\n\t\t)\n\n\t\t// Get datum x and y values\n\t\tconst xValue = getXValue(datum)\n\t\tconst yValue = getYValue(datum)\n\n\t\t// To be an anomaly, the value has to be higher or equal than the threshold value\n\t\t// (if are present, both range and domain threshold values)\n\t\tif (yThreshold && xThreshold) {\n\t\t\treturn yValue <= yThreshold.scaleValue && xValue >= xThreshold.scaleValue\n\t\t}\n\n\t\tif (yThreshold) {\n\t\t\treturn yValue <= yThreshold.scaleValue\n\t\t}\n\n\t\tif (xThreshold) {\n\t\t\treturn xValue >= xThreshold.scaleValue\n\t\t}\n\n\t\treturn false\n\t}\n\n\tstyleCircles(selection: Selection<SVGCircleElement, any, Element, any>, animate: boolean) {\n\t\t// Chart options mixed with the internal configurations\n\t\tconst options = this.getOptions()\n\t\tconst { filled, fillOpacity } = options.points\n\t\tconst { cartesianScales } = this.services\n\t\tif (!cartesianScales) throw new Error('Cartesian scales service is undefined')\n\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst getDomainValue = (d: any) => cartesianScales.getDomainValue(d)\n\t\tconst getRangeValue = (d: any) => cartesianScales.getRangeValue(d)\n\t\tconst [getXValue, getYValue] = flipDomainAndRangeBasedOnOrientation(\n\t\t\tgetDomainValue,\n\t\t\tgetRangeValue,\n\t\t\tcartesianScales.getOrientation()\n\t\t)\n\n\t\tconst { fadeInOnChartHolderMouseover } = this.configs\n\n\t\tselection\n\t\t\t.raise()\n\t\t\t.classed('dot', true)\n\t\t\t.attr('class', (d: any) => {\n\t\t\t\t// one element in ChartTabularData (Record<string, any>)\n\t\t\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier(d)\n\t\t\t\tconst isFilled = this.model.getIsFilled(d[groupMapsTo], d[domainIdentifier], d, filled)\n\t\t\t\tconst classNamesNeeded = isFilled\n\t\t\t\t\t? [ColorClassNameTypes.FILL, ColorClassNameTypes.STROKE]\n\t\t\t\t\t: [ColorClassNameTypes.STROKE]\n\n\t\t\t\treturn (\n\t\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\t\tclassNameTypes: classNamesNeeded,\n\t\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\t\toriginalClassName: 'dot'\n\t\t\t\t\t}) || ''\n\t\t\t\t)\n\t\t\t})\n\t\t\t// Set class to highlight the dots that are above all the thresholds, in both directions (vertical and horizontal)\n\t\t\t.classed('threshold-anomaly', (d: any) => this.isDatapointThresholdAnomaly(d))\n\t\t\t.classed('filled', (d: any) => {\n\t\t\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier(d)\n\t\t\t\treturn this.model.getIsFilled(d[groupMapsTo], d[domainIdentifier], d, filled)\n\t\t\t})\n\t\t\t.classed('unfilled', (d: any) => {\n\t\t\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier(d)\n\t\t\t\treturn !this.model.getIsFilled(d[groupMapsTo], d[domainIdentifier], d, filled)\n\t\t\t})\n\t\t\t.transition()\n\t\t\t.call(\n\t\t\t\t(t: any) =>\n\t\t\t\t\tthis.services.transitions?.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'scatter-update-enter',\n\t\t\t\t\t\tanimate\n\t\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('cx', getXValue)\n\t\t\t.attr('cy', getYValue)\n\t\t\t.attr('r', options.points.radius)\n\t\t\t.style('fill', (d: any) => {\n\t\t\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier(d)\n\t\t\t\tif (this.model.getIsFilled(d[groupMapsTo], d[domainIdentifier], d, filled)) {\n\t\t\t\t\treturn this.model.getFillColor(d[groupMapsTo], d[domainIdentifier], d)\n\t\t\t\t}\n\t\t\t})\n\t\t\t.style('stroke', (d: any) => {\n\t\t\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier(d)\n\t\t\t\treturn this.model.getStrokeColor(d[groupMapsTo], d[domainIdentifier], d)\n\t\t\t})\n\t\t\t.attr('fill-opacity', filled ? fillOpacity : 1)\n\t\t\t.attr('opacity', fadeInOnChartHolderMouseover ? 0 : 1)\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'point')\n\t\t\t.attr('aria-label', (d: any) => {\n\t\t\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier(d)\n\t\t\t\treturn d[rangeIdentifier]\n\t\t\t})\n\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners()\n\t}\n\n\thandleChartHolderOnHover = () => {\n\t\tif (!this.parent) throw new Error('Parent not defined')\n\t\tthis.parent\n\t\t\t.selectAll('circle.dot')\n\t\t\t.transition('chart-holder-hover-scatter')\n\t\t\t.call(\n\t\t\t\t(t: any) =>\n\t\t\t\t\tthis.services.transitions?.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'chart-holder-hover-scatter'\n\t\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\thandleChartHolderOnMouseOut = () => {\n\t\tif (!this.parent) throw new Error('Parent not defined')\n\t\tthis.parent\n\t\t\t.selectAll('circle.dot')\n\t\t\t.transition('chart-holder-mouseout-scatter')\n\t\t\t.call(\n\t\t\t\t(t: any) =>\n\t\t\t\t\tthis.services.transitions?.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'chart-holder-mouseout-scatter'\n\t\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 0)\n\t}\n\n\t// TODO: follow signature of EventListenerOrEventListenerObject\n\thandleLegendOnHover = (evt: CustomEvent) => {\n\t\tconst { hoveredElement } = evt.detail\n\t\tconst { groupMapsTo } = this.getOptions().data\n\n\t\tif (!this.parent) throw new Error('Parent not defined')\n\t\tthis.parent\n\t\t\t.selectAll('circle.dot')\n\t\t\t.transition('legend-hover-scatter')\n\t\t\t.call(\n\t\t\t\t(t: any) =>\n\t\t\t\t\tthis.services.transitions?.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'legend-hover-scatter'\n\t\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => (d[groupMapsTo] !== hoveredElement.datum()['name'] ? 0.3 : 1))\n\t}\n\n\thandleLegendMouseOut = () => {\n\t\tif (!this.parent) throw new Error('Parent not defined')\n\n\t\tthis.parent\n\t\t\t.selectAll('circle.dot')\n\t\t\t.transition('legend-mouseout-scatter')\n\t\t\t.call(\n\t\t\t\t(t: any) =>\n\t\t\t\t\tthis.services.transitions?.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'legend-mouseout-scatter'\n\t\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\t// Extended in bubble graphs\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tgetTooltipAdditionalItems(datum: any) {\n\t\treturn null as any\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this\n\t\tconst { groupMapsTo } = self.getOptions().data\n\n\t\tif (!this.parent) throw new Error('Parent not defined')\n\t\tthis.parent\n\t\t\t.selectAll('circle')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\thoveredElement\n\t\t\t\t\t.classed('hovered', true)\n\t\t\t\t\t.attr('class', (d: any) =>\n\t\t\t\t\t\tself.model.getColorClassName({\n\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\t\t\toriginalClassName: hoveredElement.attr('class')\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.style('fill', (d: any) => {\n\t\t\t\t\t\tconst domainIdentifier = self.services.cartesianScales?.getDomainIdentifier(d)\n\t\t\t\t\t\treturn self.model.getFillColor(d[groupMapsTo], d[domainIdentifier], d)\n\t\t\t\t\t})\n\t\t\t\t\t.classed('unfilled', false)\n\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events?.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\tdata: [datum],\n\t\t\t\t\tadditionalItems: self.getTooltipAdditionalItems(datum)\n\t\t\t\t})\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events?.dispatchEvent(Events.Scatter.SCATTER_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events?.dispatchEvent(Events.Scatter.SCATTER_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events?.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events?.dispatchEvent(Events.Scatter.SCATTER_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', false)\n\n\t\t\t\tif (!self.configs.filled) {\n\t\t\t\t\tconst { filled } = self.getOptions().points\n\t\t\t\t\tconst domainIdentifier = self.services.cartesianScales?.getDomainIdentifier(datum)\n\t\t\t\t\tconst isFilled = self.model.getIsFilled(\n\t\t\t\t\t\tdatum[groupMapsTo],\n\t\t\t\t\t\tdatum[domainIdentifier],\n\t\t\t\t\t\tdatum,\n\t\t\t\t\t\tfilled\n\t\t\t\t\t)\n\t\t\t\t\thoveredElement.classed('unfilled', !isFilled).style('fill', (d: any) => {\n\t\t\t\t\t\tif (isFilled || filled) {\n\t\t\t\t\t\t\treturn self.model.getFillColor(d[groupMapsTo], d[domainIdentifier], d)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn null\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events?.dispatchEvent(Events.Scatter.SCATTER_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events?.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\tdestroy() {\n\t\t// Remove event listeners\n\t\tthis.parent?.selectAll('circle').on('mousemove', null).on('mouseout', null)\n\n\t\t// Remove legend listeners\n\t\tconst { events } = this.services\n\t\tif (!events) throw new Error('Services events undefined')\n\t\tevents.removeEventListener(\n\t\t\tEvents.Legend.ITEM_HOVER,\n\t\t\tthis.handleLegendOnHover as EventListenerOrEventListenerObject\n\t\t)\n\t\tevents.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t\tevents.removeEventListener(Events.Chart.MOUSEOVER, this.handleChartHolderOnHover)\n\t\tevents.removeEventListener(Events.Chart.MOUSEOUT, this.handleChartHolderOnMouseOut)\n\t}\n}\n","import {\n\taxisBottom,\n\taxisLeft,\n\taxisRight,\n\taxisTop,\n\ttype AxisScale,\n\tselect,\n\ttype Selection as D3Selection\n} from 'd3'\nimport { clamp } from 'lodash-es'\nimport { axis as axisConfigs } from '@/configuration'\nimport { getProperty, getTranslationValues, truncateLabel } from '@/tools'\nimport { Component } from '@/components/component'\nimport {\n\tAxisPositions,\n\tEvents,\n\tScaleTypes,\n\tTruncationTypes,\n\tAxisTitleOrientations,\n\tRenderTypes,\n\tTickRotations\n} from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\nimport type { ChartModel } from '@/model/model'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { computeTimeIntervalName, formatTick, isTickPrimary } from '@/services/time-series'\nimport { sanitizeText } from '@/utils/sanitizeHtml'\n\nexport class Axis extends Component {\n\ttype = 'axes'\n\trenderType = RenderTypes.SVG\n\n\tmargins: any\n\ttruncation = {\n\t\t[AxisPositions.LEFT]: false,\n\t\t[AxisPositions.RIGHT]: false,\n\t\t[AxisPositions.TOP]: false,\n\t\t[AxisPositions.BOTTOM]: false\n\t}\n\n\tscale: AxisScale<any>\n\tscaleType: ScaleTypes\n\n\tconstructor(model: ChartModel, services: any, configs?: any) {\n\t\tsuper(model, services, configs)\n\n\t\tif (configs) {\n\t\t\tthis.configs = configs\n\t\t}\n\n\t\tthis.margins = this.configs.margins\n\t}\n\n\trender(animate = true) {\n\t\tconst { position: axisPosition }: { position: AxisPositions } = this.configs\n\t\tconst options = this.getOptions()\n\t\tconst isAxisVisible = getProperty(options, 'axes', axisPosition, 'visible')\n\n\t\tconst svg = this.getComponentContainer() as D3Selection<\n\t\t\tSVGGraphicsElement,\n\t\t\tany,\n\t\t\tHTMLElement,\n\t\t\tany\n\t\t>\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\t// Add axis into the parent\n\t\tconst container = DOMUtils.appendOrSelect(svg, `g.axis.${axisPosition}`)\n\t\tlet startPosition: number, endPosition: number\n\t\tif (axisPosition === AxisPositions.BOTTOM || axisPosition === AxisPositions.TOP) {\n\t\t\tstartPosition = this.configs.axes[AxisPositions.LEFT] ? this.margins.left : 0\n\t\t\tendPosition = this.configs.axes[AxisPositions.RIGHT] ? width - this.margins.right : width\n\t\t} else {\n\t\t\tstartPosition = height - this.margins.bottom\n\t\t\tendPosition = this.margins.top\n\t\t}\n\n\t\t// Grab the scale off of the Scales service\n\t\tif (!this.services.cartesianScales) throw new Error('Services cartesianScales undefined')\n\t\tconst scale = this.services.cartesianScales.getScaleByPosition(axisPosition) as any\n\n\t\tif (this.scaleType === ScaleTypes.LABELS || this.scaleType === ScaleTypes.LABELS_RATIO) {\n\t\t\tscale.rangeRound([startPosition, endPosition])\n\t\t} else {\n\t\t\tscale.range([startPosition, endPosition])\n\t\t}\n\n\t\t// Identify the corresponding d3 axis function\n\t\tlet axisFunction: any\n\t\tswitch (axisPosition) {\n\t\t\tcase AxisPositions.LEFT:\n\t\t\t\taxisFunction = axisLeft\n\t\t\t\tbreak\n\t\t\tcase AxisPositions.BOTTOM:\n\t\t\t\taxisFunction = axisBottom\n\t\t\t\tbreak\n\t\t\tcase AxisPositions.RIGHT:\n\t\t\t\taxisFunction = axisRight\n\t\t\t\tbreak\n\t\t\tcase AxisPositions.TOP:\n\t\t\t\taxisFunction = axisTop\n\t\t\t\tbreak\n\t\t}\n\n\t\tcontainer.attr('aria-label', `${axisPosition} axis`)\n\t\tconst axisRefExists = !container.select(`g.ticks`).empty()\n\t\tlet axisRef = DOMUtils.appendOrSelect(container, `g.ticks`)\n\t\tif (!axisRefExists) {\n\t\t\taxisRef.attr('role', `${Roles.GRAPHICS_OBJECT} ${Roles.GROUP}`)\n\t\t\taxisRef.attr('aria-label', `${axisPosition} ticks`)\n\t\t}\n\n\t\t// We draw the invisible axis because of the async nature of d3 transitions\n\t\t// To be able to tell the final width & height of the axis when initiaing the transition\n\t\t// The invisible axis is updated instantly and without a transition\n\t\tconst invisibleAxisRef = DOMUtils.appendOrSelect(container, `g.ticks.invisible`)\n\t\t\t.style('opacity', '0')\n\t\t\t.style('pointer-events', 'none')\n\t\t\t.attr('aria-hidden', true)\n\t\t\t.attr('aria-label', `invisible ${axisPosition} ticks`)\n\n\t\tconst axisOptions = getProperty(options, 'axes', axisPosition)\n\t\tconst isTimeScaleType =\n\t\t\tthis.scaleType === ScaleTypes.TIME || axisOptions.scaleType === ScaleTypes.TIME\n\t\tconst isVerticalAxis =\n\t\t\taxisPosition === AxisPositions.LEFT || axisPosition === AxisPositions.RIGHT\n\n\t\t// if zoomDomain is available, scale type is time, and axis position isBOTTOM or TOP\n\t\t// update scale domain to zoomDomain.\n\t\tconst zoomDomain = this.model.get('zoomDomain')\n\t\tif (zoomDomain && isTimeScaleType && !isVerticalAxis) {\n\t\t\tscale.domain(zoomDomain)\n\t\t}\n\n\t\tif (!isAxisVisible) {\n\t\t\taxisRef.attr('aria-hidden', true)\n\t\t\treturn\n\t\t}\n\n\t\tconst axisScaleType = getProperty(axisOptions, 'scaleType')\n\t\tconst isDataLoading = getProperty(options, 'data', 'loading')\n\t\tconst numberOfTicksProvided = getProperty(axisOptions, 'ticks', 'number')\n\n\t\t// user can provide custom ticks to be displayed\n\t\t// ticks need to be in the domain of the axis data\n\t\tconst userProvidedTickValues = getProperty(axisOptions, 'ticks', 'values')\n\n\t\t// get user provided custom values for truncation\n\t\tconst truncationType = getProperty(axisOptions, 'truncation', 'type')\n\t\tconst truncationThreshold = getProperty(axisOptions, 'truncation', 'threshold')\n\t\tconst truncationNumCharacter = getProperty(axisOptions, 'truncation', 'numCharacter')\n\n\t\tconst isNumberOfTicksProvided = numberOfTicksProvided !== null\n\t\tconst timeScaleOptions = getProperty(options, 'timeScale')\n\n\t\t// Append to DOM a fake tick to get the right computed font height\n\t\tconst fakeTick = DOMUtils.appendOrSelect(invisibleAxisRef, `g.tick`)\n\t\tconst fakeTickText = DOMUtils.appendOrSelect(fakeTick, `text`).text('0')\n\t\tconst tickHeight = DOMUtils.getSVGElementSize(fakeTickText.node(), {\n\t\t\tuseBBox: true\n\t\t}).height\n\t\tfakeTick.remove()\n\n\t\tconst scaleType = this.scaleType || axisOptions.scaleType || ScaleTypes.LINEAR\n\n\t\t// Initialize axis object\n\t\tconst axis = axisFunction(scale).tickSizeOuter(0)\n\n\t\tif (scale.ticks) {\n\t\t\tlet numberOfTicks: number\n\n\t\t\tif (isNumberOfTicksProvided) {\n\t\t\t\tnumberOfTicks = numberOfTicksProvided\n\t\t\t} else {\n\t\t\t\tnumberOfTicks = axisConfigs.ticks.number\n\t\t\t\tif (isVerticalAxis) {\n\t\t\t\t\t// Set how many ticks based on height\n\t\t\t\t\tnumberOfTicks = this.getNumberOfFittingTicks(\n\t\t\t\t\t\theight,\n\t\t\t\t\t\ttickHeight,\n\t\t\t\t\t\taxisConfigs.ticks.verticalSpaceRatio\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// scale continuous\n\t\t\t// remove 0 ticks for skeleton\n\t\t\tif (scale.ticks().length === 1 && scale.ticks()[0] === 0) {\n\t\t\t\tnumberOfTicks = 0\n\t\t\t}\n\n\t\t\taxis.ticks(numberOfTicks)\n\n\t\t\tif (isTimeScaleType) {\n\t\t\t\tif (!scale.ticks(numberOfTicks).length) {\n\t\t\t\t\taxis.tickValues([])\n\t\t\t\t} else {\n\t\t\t\t\tconst addSpaceOnEdges = getProperty(options, 'timeScale', 'addSpaceOnEdges')\n\n\t\t\t\t\tconst customDomain = getProperty(options, 'axes', axisPosition, 'domain')\n\n\t\t\t\t\t// scale.nice() will change scale domain which causes extra space near chart edge\n\t\t\t\t\t// so use another scale instance to avoid impacts to original scale\n\t\t\t\t\tconst tempScale = scale.copy()\n\t\t\t\t\tif (addSpaceOnEdges && !customDomain) {\n\t\t\t\t\t\ttempScale.nice(numberOfTicks)\n\t\t\t\t\t}\n\t\t\t\t\tconst tickValues = tempScale.ticks(numberOfTicks)\n\n\t\t\t\t\t// Remove labels on the edges\n\t\t\t\t\t// If there are more than 2 labels to show\n\t\t\t\t\tif (addSpaceOnEdges && tickValues.length > 2 && !customDomain) {\n\t\t\t\t\t\ttickValues.splice(tickValues.length - 1, 1)\n\t\t\t\t\t\ttickValues.splice(0, 1)\n\t\t\t\t\t}\n\n\t\t\t\t\taxis.tickValues(tickValues)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// create the right ticks formatter\n\t\tlet formatter: any\n\t\tconst userProvidedFormatter = getProperty(axisOptions, 'ticks', 'formatter')\n\t\tif (isTimeScaleType) {\n\t\t\tconst timeInterval = computeTimeIntervalName(\n\t\t\t\taxis.tickValues(),\n\t\t\t\tgetProperty(options, 'timeScale', 'timeInterval')\n\t\t\t)\n\n\t\t\tif (userProvidedFormatter === null) {\n\t\t\t\tformatter = (t: number, i: number) =>\n\t\t\t\t\tformatTick(t, i, axis.tickValues(), timeInterval, timeScaleOptions)\n\t\t\t} else {\n\t\t\t\tformatter = (t: number, i: number) => {\n\t\t\t\t\tconst defaultFormattedValue = formatTick(\n\t\t\t\t\t\tt,\n\t\t\t\t\t\ti,\n\t\t\t\t\t\taxis.tickValues(),\n\t\t\t\t\t\ttimeInterval,\n\t\t\t\t\t\ttimeScaleOptions\n\t\t\t\t\t)\n\t\t\t\t\treturn userProvidedFormatter(t, i, defaultFormattedValue)\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (userProvidedFormatter === null) {\n\t\t\t\tif (scaleType === ScaleTypes.LINEAR) {\n\t\t\t\t\tformatter = (t: any) => t.toLocaleString()\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tformatter = userProvidedFormatter\n\t\t\t}\n\t\t}\n\n\t\t// Set ticks formatter\n\t\taxis.tickFormat(formatter)\n\n\t\t// prioritize using a custom array of values rather than number of ticks\n\t\t// if both are provided. custom tick values need to be within the domain of the scale\n\t\tconst [lowerBound, upperBound] = this.services.cartesianScales\n\t\t\t.getScaleByPosition(axisPosition)\n\t\t\t.domain()\n\t\tlet validTicks: any\n\t\tif (userProvidedTickValues) {\n\t\t\tif (isTimeScaleType) {\n\t\t\t\t// sanitize user-provided tick values\n\t\t\t\tuserProvidedTickValues.forEach((userProvidedTickValue: any, i: number) => {\n\t\t\t\t\tif (userProvidedTickValue.getTime === undefined) {\n\t\t\t\t\t\tuserProvidedTickValues[i] = new Date(userProvidedTickValue)\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t\t// check the supplied ticks are within the time domain\n\t\t\t\tvalidTicks = userProvidedTickValues.filter((tick: any) => {\n\t\t\t\t\tconst tickTimestamp = tick.getTime()\n\t\t\t\t\treturn (\n\t\t\t\t\t\ttickTimestamp >= new Date(lowerBound).getTime() &&\n\t\t\t\t\t\ttickTimestamp <= new Date(upperBound).getTime()\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t} else if (axisScaleType === ScaleTypes.LABELS) {\n\t\t\t\tconst discreteDomain = this.services.cartesianScales\n\t\t\t\t\t.getScaleByPosition(axisPosition)\n\t\t\t\t\t.domain()\n\t\t\t\tvalidTicks = userProvidedTickValues.filter((tick: any) => discreteDomain.includes(tick))\n\t\t\t} else {\n\t\t\t\t// continuous scales\n\t\t\t\tvalidTicks = userProvidedTickValues.filter(\n\t\t\t\t\t(tick: any) => tick >= lowerBound && tick <= upperBound\n\t\t\t\t)\n\t\t\t}\n\n\t\t\taxis.tickValues(validTicks)\n\t\t}\n\n\t\t// Position and transition the axis\n\t\tswitch (axisPosition) {\n\t\t\tcase AxisPositions.LEFT:\n\t\t\t\taxisRef.attr('transform', `translate(${this.margins.left}, 0)`)\n\t\t\t\tbreak\n\t\t\tcase AxisPositions.BOTTOM:\n\t\t\t\taxisRef.attr('transform', `translate(0, ${height - this.margins.bottom})`)\n\t\t\t\tbreak\n\t\t\tcase AxisPositions.RIGHT:\n\t\t\t\taxisRef.attr('transform', `translate(${width - this.margins.right}, 0)`)\n\t\t\t\tbreak\n\t\t\tcase AxisPositions.TOP:\n\t\t\t\taxisRef.attr('transform', `translate(0, ${this.margins.top})`)\n\t\t\t\tbreak\n\t\t}\n\n\t\t// Position the axis title\n\t\t// check that data exists, if they don't, doesn't show the title axis\n\t\tconst isDataEmpty = this.model.isDataEmpty()\n\t\tif (axisOptions.title) {\n\t\t\tconst axisTitleRef = DOMUtils.appendOrSelect(container, `text.axis-title`).html(\n\t\t\t\tisDataEmpty || isDataLoading ? '' : sanitizeText(axisOptions.title)\n\t\t\t)\n\n\t\t\t// vertical axes can have override for title orientation\n\t\t\tconst titleOrientation = getProperty(axisOptions, 'titleOrientation')\n\t\t\tlet titleHeight // avoid lexical declaration in case block\n\t\t\tswitch (axisPosition) {\n\t\t\t\tcase AxisPositions.LEFT:\n\t\t\t\t\tif (titleOrientation === AxisTitleOrientations.RIGHT) {\n\t\t\t\t\t\taxisTitleRef\n\t\t\t\t\t\t\t.attr('transform', 'rotate(90)')\n\t\t\t\t\t\t\t.attr('y', 0)\n\t\t\t\t\t\t\t.attr('x', scale.range()[0] / 2)\n\t\t\t\t\t\t\t.attr('dy', '-0.5em')\n\t\t\t\t\t\t\t.style('text-anchor', 'middle')\n\t\t\t\t\t} else {\n\t\t\t\t\t\taxisTitleRef\n\t\t\t\t\t\t\t.attr('transform', 'rotate(-90)')\n\t\t\t\t\t\t\t.attr('y', 0)\n\t\t\t\t\t\t\t.attr('x', -(scale.range()[0] / 2))\n\t\t\t\t\t\t\t.attr('dy', '0.75em')\n\t\t\t\t\t\t\t.style('text-anchor', 'middle')\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase AxisPositions.BOTTOM:\n\t\t\t\t\taxisTitleRef\n\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t'transform',\n\t\t\t\t\t\t\t`translate(${this.margins.left / 2 + scale.range()[1] / 2}, ${height + 4})`\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.style('text-anchor', 'middle')\n\t\t\t\t\tbreak\n\t\t\t\tcase AxisPositions.RIGHT:\n\t\t\t\t\tif (titleOrientation === AxisTitleOrientations.LEFT) {\n\t\t\t\t\t\taxisTitleRef\n\t\t\t\t\t\t\t.attr('transform', 'rotate(-90)')\n\t\t\t\t\t\t\t.attr('y', width)\n\t\t\t\t\t\t\t.attr('x', -(scale.range()[0] / 2))\n\t\t\t\t\t\t\t.style('text-anchor', 'middle')\n\t\t\t\t\t} else {\n\t\t\t\t\t\taxisTitleRef\n\t\t\t\t\t\t\t.attr('transform', 'rotate(90)')\n\t\t\t\t\t\t\t.attr('y', -width)\n\t\t\t\t\t\t\t.attr('x', scale.range()[0] / 2)\n\t\t\t\t\t\t\t.attr('dy', '0.75em')\n\t\t\t\t\t\t\t.style('text-anchor', 'middle')\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase AxisPositions.TOP:\n\t\t\t\t\ttitleHeight = DOMUtils.getSVGElementSize(axisTitleRef, {\n\t\t\t\t\t\tuseBBox: true\n\t\t\t\t\t}).height\n\n\t\t\t\t\taxisTitleRef\n\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t'transform',\n\t\t\t\t\t\t\t`translate(${this.margins.left / 2 + scale.range()[1] / 2}, ${titleHeight / 2})`\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.style('text-anchor', 'middle')\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t// Apply new axis to the axis element\n\t\tif (isTimeScaleType) {\n\t\t\tconst timeInterval = computeTimeIntervalName(\n\t\t\t\taxis.tickValues(),\n\t\t\t\tgetProperty(options, 'timeScale', 'timeInterval')\n\t\t\t)\n\n\t\t\tconst showDayName = timeScaleOptions.showDayName\n\t\t\tconst axisRefSelection = axisRef\n\n\t\t\tif (animate) {\n\t\t\t\taxisRef = axisRef.transition().call((t: any) =>\n\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'axis-update',\n\t\t\t\t\t\tanimate\n\t\t\t\t\t})\n\t\t\t\t) as any\n\t\t\t}\n\t\t\taxisRef = axisRef.call(axis)\n\n\t\t\t// Manipulate tick labels to make bold those that are in long format\n\t\t\tconst ticks = axisRefSelection\n\t\t\t\t.selectAll('.tick')\n\t\t\t\t.data(axis.tickValues(), scale)\n\t\t\t\t.order()\n\t\t\t\t.select('text')\n\t\t\tticks.style('font-weight', (tick: number, i: number) => {\n\t\t\t\treturn isTickPrimary(tick, i, axis.tickValues(), timeInterval, showDayName)\n\t\t\t\t\t? 'bold'\n\t\t\t\t\t: 'normal'\n\t\t\t})\n\t\t} else {\n\t\t\tif (!animate || !axisRefExists) {\n\t\t\t\taxisRef = axisRef.call(axis)\n\t\t\t} else {\n\t\t\t\taxisRef = axisRef\n\t\t\t\t\t.transition()\n\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\tname: 'axis-update',\n\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.call(axis) as any\n\t\t\t}\n\t\t}\n\n\t\tinvisibleAxisRef.call(axis)\n\n\t\tif (axisPosition === AxisPositions.BOTTOM || axisPosition === AxisPositions.TOP) {\n\t\t\tlet shouldRotateTicks = false\n\t\t\t// user could decide if tick rotation is required during zoom domain changing\n\t\t\tconst tickRotation = getProperty(axisOptions, 'ticks', 'rotation')\n\n\t\t\tif (tickRotation === TickRotations.ALWAYS) {\n\t\t\t\tshouldRotateTicks = true\n\t\t\t} else if (tickRotation === TickRotations.NEVER) {\n\t\t\t\tshouldRotateTicks = false\n\t\t\t} else if (!tickRotation || tickRotation === TickRotations.AUTO) {\n\t\t\t\t// if the option is not set or set to AUTO\n\n\t\t\t\t// depending on if tick rotation is necessary by calculating space\n\t\t\t\t// If we're dealing with a discrete scale type\n\t\t\t\t// We're able to grab the spacing between the ticks\n\t\t\t\tif (scale.step) {\n\t\t\t\t\tconst textNodes = invisibleAxisRef.selectAll('g.tick text').nodes() as any\n\n\t\t\t\t\t// If any ticks are any larger than the scale step size\n\t\t\t\t\tshouldRotateTicks = textNodes.some(\n\t\t\t\t\t\t(textNode: D3Selection<SVGGraphicsElement, any, Element, any>) =>\n\t\t\t\t\t\t\tDOMUtils.getSVGElementSize(textNode, {\n\t\t\t\t\t\t\t\tuseBBox: true\n\t\t\t\t\t\t\t}).width >= scale.step()\n\t\t\t\t\t)\n\t\t\t\t} else {\n\t\t\t\t\tshouldRotateTicks = false\n\n\t\t\t\t\tconst mockTextPiece = invisibleAxisRef.append('text').text('A')\n\n\t\t\t\t\tconst averageLetterWidth = DOMUtils.getSVGElementSize(mockTextPiece.node() as any, {\n\t\t\t\t\t\tuseBBox: true\n\t\t\t\t\t}).width as number\n\n\t\t\t\t\tlet lastStartPosition: any\n\n\t\t\t\t\t// Find out whether any text nodes roughly collide\n\t\t\t\t\tinvisibleAxisRef.selectAll('g.tick').each(function () {\n\t\t\t\t\t\tconst selection = select(this)\n\t\t\t\t\t\tconst xTransformation = parseFloat(getProperty(getTranslationValues(this as any), 'tx'))\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\txTransformation !== null &&\n\t\t\t\t\t\t\tlastStartPosition + selection.text().length * averageLetterWidth * 0.8 >=\n\t\t\t\t\t\t\t\txTransformation\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tshouldRotateTicks = true\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlastStartPosition = xTransformation\n\t\t\t\t\t})\n\n\t\t\t\t\t// Cleanup mock text piece\n\t\t\t\t\tmockTextPiece.remove()\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (shouldRotateTicks) {\n\t\t\t\tif (!isNumberOfTicksProvided) {\n\t\t\t\t\taxis.ticks(\n\t\t\t\t\t\tthis.getNumberOfFittingTicks(width, tickHeight, axisConfigs.ticks.horizontalSpaceRatio)\n\t\t\t\t\t)\n\n\t\t\t\t\tinvisibleAxisRef.call(axis)\n\t\t\t\t\taxisRef.call(axis)\n\t\t\t\t}\n\n\t\t\t\tcontainer\n\t\t\t\t\t.selectAll('g.ticks g.tick text')\n\t\t\t\t\t.attr('transform', `rotate(-45)`)\n\t\t\t\t\t.attr('text-anchor', axisPosition === AxisPositions.TOP ? 'start' : 'end')\n\t\t\t} else {\n\t\t\t\tcontainer.selectAll('g.ticks g.tick text').attr('transform', null).attr('text-anchor', null)\n\t\t\t}\n\t\t}\n\n\t\t// we don't need to show axes on empty state and on skeleton state\n\t\t// because the Skeleton component draws them\n\t\tif (isDataLoading) {\n\t\t\tcontainer.attr('opacity', 0)\n\t\t} else {\n\t\t\tcontainer.attr('opacity', 1)\n\t\t}\n\n\t\taxisRef.selectAll('g.tick').attr('aria-label', (d: any) => d)\n\n\t\tinvisibleAxisRef.selectAll('g.tick').attr('aria-label', (d: any) => d)\n\n\t\t// truncate the label if it's too long\n\t\t// only applies to discrete type\n\t\tif (\n\t\t\ttruncationType !== TruncationTypes.NONE &&\n\t\t\taxisScaleType === ScaleTypes.LABELS &&\n\t\t\t!userProvidedTickValues\n\t\t) {\n\t\t\tconst axisTickLabels = this.services.cartesianScales.getScaleDomain(axisPosition)\n\t\t\tif (axisTickLabels.length > 0) {\n\t\t\t\tconst tick_html = svg.select(`g.axis.${axisPosition} g.ticks g.tick`).html()\n\n\t\t\t\tcontainer.selectAll('g.ticks g.tick').html(tick_html)\n\n\t\t\t\tconst self = this\n\t\t\t\tcontainer\n\t\t\t\t\t.selectAll('g.tick text')\n\t\t\t\t\t.data(axisTickLabels)\n\t\t\t\t\t.text(function (d: any) {\n\t\t\t\t\t\tif (d.length > truncationThreshold) {\n\t\t\t\t\t\t\tself.truncation[axisPosition] = true\n\t\t\t\t\t\t\treturn truncateLabel(d, truncationType, truncationNumCharacter)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn d\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\n\t\t\t\tthis.getInvisibleAxisRef()\n\t\t\t\t\t.selectAll('g.tick text')\n\t\t\t\t\t.data(axisTickLabels)\n\t\t\t\t\t.text(function (d: any) {\n\t\t\t\t\t\tif (d.length > truncationThreshold) {\n\t\t\t\t\t\t\treturn truncateLabel(d, truncationType, truncationNumCharacter)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn d\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\n\t\t\t\tcontainer.selectAll('g.ticks').html(this.getInvisibleAxisRef().html())\n\n\t\t\t\tcontainer.selectAll('g.tick text').data(axisTickLabels)\n\t\t\t}\n\t\t}\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners()\n\t}\n\n\taddEventListeners() {\n\t\tconst svg = this.getComponentContainer()\n\t\tconst { position: axisPosition } = this.configs\n\t\tconst container = DOMUtils.appendOrSelect(svg, `g.axis.${axisPosition}`)\n\t\tconst options = this.getOptions()\n\t\tconst axisOptions = getProperty(options, 'axes', axisPosition)\n\t\tconst axisScaleType = getProperty(axisOptions, 'scaleType')\n\t\tconst truncationThreshold = getProperty(axisOptions, 'truncation', 'threshold')\n\n\t\tconst self = this\n\t\tcontainer\n\t\t\t.selectAll('g.tick text')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tif (axisScaleType === ScaleTypes.LABELS && datum.length > truncationThreshold) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\thoveredElement: select(this),\n\t\t\t\t\t\tcontent: datum\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t\tif (axisScaleType === ScaleTypes.LABELS && datum.length > truncationThreshold) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\t\tevent\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tif (axisScaleType === ScaleTypes.LABELS) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE)\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\tgetInvisibleAxisRef() {\n\t\tconst { position: axisPosition } = this.configs\n\n\t\treturn this.getComponentContainer().select(`g.axis.${axisPosition} g.ticks.invisible`)\n\t}\n\n\tgetTitleRef() {\n\t\tconst { position: axisPosition } = this.configs\n\n\t\treturn this.getComponentContainer().select(`g.axis.${axisPosition} text.axis-title`)\n\t}\n\n\tgetNumberOfFittingTicks(size: number, tickSize: number, spaceRatio: number) {\n\t\tconst numberOfTicksFit = Math.floor(size / (tickSize * spaceRatio))\n\t\treturn clamp(numberOfTicksFit, 2, axisConfigs.ticks.number)\n\t}\n\n\tdestroy() {\n\t\tconst svg = this.getComponentContainer()\n\t\tconst { position: axisPosition } = this.configs\n\t\tconst container = DOMUtils.appendOrSelect(svg, `g.axis.${axisPosition}`)\n\n\t\t// Remove event listeners\n\t\tcontainer\n\t\t\t.selectAll('g.tick text')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('mouseout', null)\n\t}\n}\n","import { select, type Selection } from 'd3'\nimport { getProperty } from '@/tools'\nimport { axis as axisConfigs } from '@/configuration'\nimport { Axis } from './axis'\nimport { AxisPositions, Events, ScaleTypes } from '@/interfaces/enums'\nimport type { ChartModel } from '@/model/model'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\n\nexport class HoverAxis extends Axis {\n\tconstructor(model: ChartModel, services: any, configs?: any) {\n\t\tsuper(model, services, configs)\n\t}\n\n\trender(animate = true) {\n\t\tsuper.render(animate)\n\n\t\t// Remove existing event listeners to avoid flashing behavior\n\t\tsuper.destroy()\n\n\t\tconst axisPosition = this.configs.position as 'left' | 'right' | 'top' | 'bottom'\n\t\tconst svg = this.getComponentContainer()\n\t\tconst container = DOMUtils.appendOrSelect(svg, `g.axis.${axisPosition}`)\n\n\t\tconst self = this\n\t\tcontainer.selectAll('g.tick').each(function (_: any, index: number) {\n\t\t\tconst g = select(this) as Selection<SVGElement, any, Element, any>\n\t\t\tg.classed('tick-hover', true).attr('tabindex', index === 0 ? 0 : -1)\n\t\t\tconst textNode = g.select<SVGGraphicsElement>('text')\n\t\t\tconst { width, height } = DOMUtils.getSVGElementSize(textNode, {\n\t\t\t\tuseBBox: true\n\t\t\t})\n\n\t\t\tconst rectangle = DOMUtils.appendOrSelect(g, 'rect.axis-holder')\n\n\t\t\tlet x = 0,\n\t\t\t\ty = 0\n\n\t\t\t// Depending on axis position, apply correct translation & rotation to align the rect\n\t\t\t// with the text\n\t\t\tswitch (axisPosition) {\n\t\t\t\tcase AxisPositions.LEFT:\n\t\t\t\t\tx = -width + Number(textNode.attr('x'))\n\t\t\t\t\ty = -(height / 2)\n\t\t\t\t\tbreak\n\t\t\t\tcase AxisPositions.RIGHT:\n\t\t\t\t\tx = Math.abs(Number(textNode.attr('x')))\n\t\t\t\t\ty = -(height / 2)\n\t\t\t\t\tbreak\n\t\t\t\tcase AxisPositions.TOP:\n\t\t\t\t\tx = -(width / 2)\n\t\t\t\t\ty = -height + Number(textNode.attr('y')) / 2\n\n\t\t\t\t\tif (self.truncation[axisPosition]) {\n\t\t\t\t\t\tx = 0\n\t\t\t\t\t\trectangle.attr('transform', `rotate(-45)`)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase AxisPositions.BOTTOM:\n\t\t\t\t\tx = -(width / 2)\n\t\t\t\t\ty = height / 2 - 2\n\n\t\t\t\t\tif (self.truncation[axisPosition]) {\n\t\t\t\t\t\tx = -width\n\t\t\t\t\t\trectangle.attr('transform', `rotate(-45)`)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// Translates x position -4 left to keep center after padding\n\t\t\t// Adds padding on left & right\n\t\t\trectangle\n\t\t\t\t.attr('x', x - axisConfigs.hover.rectanglePadding)\n\t\t\t\t.attr('y', y)\n\t\t\t\t.attr('width', width + axisConfigs.hover.rectanglePadding * 2)\n\t\t\t\t.attr('height', height)\n\t\t\t\t.lower()\n\t\t})\n\n\t\t// Add event listeners to element group\n\t\tthis.addEventListeners()\n\t}\n\n\taddEventListeners() {\n\t\tconst svg = this.getComponentContainer()\n\t\tconst { position: axisPosition } = this.configs\n\t\tconst container = DOMUtils.appendOrSelect(svg, `g.axis.${axisPosition}`)\n\t\tconst options = this.getOptions()\n\t\tconst axisOptions = getProperty(options, 'axes', axisPosition)\n\t\tconst axisScaleType = getProperty(axisOptions, 'scaleType')\n\t\tconst truncationThreshold = getProperty(axisOptions, 'truncation', 'threshold')\n\n\t\tconst self = this\n\t\tcontainer\n\t\t\t.selectAll('g.tick.tick-hover')\n\t\t\t.on('mouseover', function (event: MouseEvent) {\n\t\t\t\tconst hoveredElement = select(this).select('text')\n\t\t\t\tconst datum = hoveredElement.datum() as string\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tif (axisScaleType === ScaleTypes.LABELS && datum.length > truncationThreshold) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\t\tdatum\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent) {\n\t\t\t\tconst hoveredElement = select(this).select('text')\n\t\t\t\tconst datum = hoveredElement.datum() as string\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this).select('text'),\n\t\t\t\t\tdatum: select(this).select('text').datum()\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this).select('text'),\n\t\t\t\t\tdatum: select(this).select('text').datum()\n\t\t\t\t})\n\n\t\t\t\tif (axisScaleType === ScaleTypes.LABELS) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE)\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('focus', function (event: any) {\n\t\t\t\tconst coordinates = { clientX: 0, clientY: 0 }\n\n\t\t\t\tif (event.target) {\n\t\t\t\t\t// Focus element since we are using arrow keys\n\t\t\t\t\tevent.target.focus()\n\t\t\t\t\tconst boundingRect = event.target.getBoundingClientRect()\n\t\t\t\t\tcoordinates.clientX = boundingRect.x\n\t\t\t\t\tcoordinates.clientY = boundingRect.y\n\t\t\t\t}\n\n\t\t\t\t// Dispatch focus event\n\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_FOCUS, {\n\t\t\t\t\tevent: { ...event, ...coordinates },\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum: select(this).select('text').datum()\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('blur', function (event: FocusEvent) {\n\t\t\t\t// Dispatch blur event\n\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_BLUR, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum: select(this).select('text').datum()\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('keydown', function (event: KeyboardEvent) {\n\t\t\t\t// Hide the tooltip when `Escape` is pressed, but keep focus\n\t\t\t\tif (event.key && event.key === 'Escape') {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE)\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_BLUR, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\telement: select(this),\n\t\t\t\t\t\tdatum: select(this).select('text').datum()\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\t// Choose specific arrow key depending on the axis\n\t\t\t\tif (axisPosition === AxisPositions.LEFT || axisPosition === AxisPositions.RIGHT) {\n\t\t\t\t\tif (event.key && event.key === 'ArrowUp') {\n\t\t\t\t\t\tself.goNext(this as HTMLElement, event)\n\t\t\t\t\t} else if (event.key && event.key === 'ArrowDown') {\n\t\t\t\t\t\tself.goPrevious(this as HTMLElement, event)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (event.key && event.key === 'ArrowLeft') {\n\t\t\t\t\t\tself.goPrevious(this as HTMLElement, event)\n\t\t\t\t\t} else if (event.key && event.key === 'ArrowRight') {\n\t\t\t\t\t\tself.goNext(this as HTMLElement, event)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\t// Focus on the next HTML element sibling\n\tprivate goNext(element: HTMLElement, event: KeyboardEvent) {\n\t\tif (element.nextElementSibling && element.nextElementSibling.tagName !== 'path') {\n\t\t\telement.nextElementSibling.dispatchEvent(new Event('focus'))\n\t\t}\n\n\t\tevent.preventDefault()\n\t}\n\n\t// Focus on the previous HTML element sibling\n\tprivate goPrevious(element: HTMLElement, event: KeyboardEvent) {\n\t\tif (element.previousElementSibling && element.previousElementSibling.tagName !== 'path') {\n\t\t\telement.previousElementSibling.dispatchEvent(new Event('focus'))\n\t\t}\n\n\t\tevent.preventDefault()\n\t}\n\n\tdestroy() {\n\t\tconst svg = this.getComponentContainer()\n\t\tconst { position: axisPosition } = this.configs\n\t\tconst container = DOMUtils.appendOrSelect(svg, `g.axis.${axisPosition}`)\n\n\t\t// Remove event listeners\n\t\tcontainer\n\t\t\t.selectAll('g.tick.tick-hover')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('mouseout', null)\n\t\t\t.on('focus', null)\n\t\t\t.on('blur', null)\n\t}\n}\n","import { getProperty } from '@/tools'\nimport { Axis } from './axis'\nimport { HoverAxis } from './hover-axis'\nimport { Component } from '@/components/component'\nimport type { Threshold } from '@/components/essentials/threshold'\nimport { AxisPositions, Events, RenderTypes, AxisFlavor } from '@/interfaces/enums'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport type { ChartModelCartesian } from '@/model/cartesian-charts'\n\nexport class TwoDimensionalAxes extends Component {\n\ttype = '2D-axes'\n\trenderType = RenderTypes.SVG\n\n\tchildren: any = {}\n\n\tthresholds: Threshold[] = []\n\n\tmargins = {\n\t\ttop: 0,\n\t\tright: 0,\n\t\tbottom: 0,\n\t\tleft: 0\n\t}\n\n\trender(animate = false) {\n\t\tconst axes: any = {}\n\t\tconst axisPositions = Object.keys(AxisPositions)\n\t\tconst axesOptions = getProperty(this.getOptions(), 'axes')\n\n\t\taxisPositions.forEach((axisPosition: keyof typeof AxisPositions) => {\n\t\t\tconst axisOptions = axesOptions[AxisPositions[axisPosition]]\n\t\t\tif (axisOptions) {\n\t\t\t\taxes[AxisPositions[axisPosition]] = true\n\t\t\t}\n\t\t})\n\n\t\tthis.configs.axes = axes\n\n\t\t// Check the configs to know which axes need to be rendered\n\t\taxisPositions.forEach((axisPositionKey: keyof typeof AxisPositions) => {\n\t\t\tconst axisPosition = AxisPositions[axisPositionKey]\n\t\t\tif (this.configs.axes[axisPosition] && !this.children[axisPosition]) {\n\t\t\t\tconst configs = {\n\t\t\t\t\tposition: axisPosition,\n\t\t\t\t\taxes: this.configs.axes,\n\t\t\t\t\tmargins: this.margins\n\t\t\t\t}\n\n\t\t\t\tconst axisComponent =\n\t\t\t\t\t(this.model as ChartModelCartesian).axisFlavor === AxisFlavor.DEFAULT\n\t\t\t\t\t\t? new Axis(this.model, this.services, configs)\n\t\t\t\t\t\t: new HoverAxis(this.model, this.services, configs)\n\n\t\t\t\t// Set model, services & parent for the new axis component\n\t\t\t\taxisComponent.setModel(this.model)\n\t\t\t\taxisComponent.setServices(this.services)\n\t\t\t\taxisComponent.setParent(this.parent)\n\n\t\t\t\tthis.children[axisPosition] = axisComponent\n\t\t\t}\n\t\t})\n\n\t\tObject.keys(this.children).forEach((childKey: any) => {\n\t\t\tconst child = this.children[childKey]\n\t\t\tchild.render(animate)\n\t\t})\n\n\t\tconst margins = {} as any\n\n\t\tObject.keys(this.children).forEach((childKey: any) => {\n\t\t\tconst child = this.children[childKey]\n\t\t\tconst axisPosition = child.configs.position\n\n\t\t\t// Grab the invisibly rendered axis' width & height, and set margins\n\t\t\t// Based off of that\n\t\t\t// We draw the invisible axis because of the async nature of d3 transitions\n\t\t\t// To be able to tell the final width & height of the axis when initiaing the transition\n\t\t\t// The invisible axis is updated instantly and without a transition\n\t\t\tconst invisibleAxisRef = child.getInvisibleAxisRef()\n\t\t\tconst { width, height } = DOMUtils.getSVGElementSize(invisibleAxisRef, { useBBox: true })\n\n\t\t\tlet offset: any\n\t\t\tif (child.getTitleRef().empty()) {\n\t\t\t\toffset = 0\n\t\t\t} else {\n\t\t\t\toffset = DOMUtils.getSVGElementSize(child.getTitleRef(), {\n\t\t\t\t\tuseBBox: true\n\t\t\t\t}).height\n\n\t\t\t\tif (axisPosition === AxisPositions.LEFT || axisPosition === AxisPositions.RIGHT) {\n\t\t\t\t\toffset += 5\n\t\t\t\t}\n\t\t\t}\n\t\t\tswitch (axisPosition) {\n\t\t\t\tcase AxisPositions.TOP:\n\t\t\t\t\tmargins.top = height + offset\n\t\t\t\t\tbreak\n\t\t\t\tcase AxisPositions.BOTTOM:\n\t\t\t\t\tmargins.bottom = height + offset\n\t\t\t\t\tbreak\n\t\t\t\tcase AxisPositions.LEFT:\n\t\t\t\t\tmargins.left = width + offset\n\t\t\t\t\tbreak\n\t\t\t\tcase AxisPositions.RIGHT:\n\t\t\t\t\tmargins.right = width + offset\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t})\n\n\t\tthis.services.events.dispatchEvent(Events.Axis.RENDER_COMPLETE)\n\n\t\t// If the new margins are different than the existing ones\n\t\tconst isNotEqual = Object.keys(margins).some(\n\t\t\t(marginKey: 'top' | 'right' | 'bottom' | 'left') => {\n\t\t\t\treturn this.margins[marginKey] !== margins[marginKey]\n\t\t\t}\n\t\t)\n\n\t\tif (isNotEqual) {\n\t\t\tthis.margins = Object.assign(this.margins, margins)\n\n\t\t\t// also set new margins to model to allow external components to access\n\t\t\tthis.model.set({ axesMargins: this.margins }, { skipUpdate: true })\n\t\t\tthis.services.events.dispatchEvent(Events.ZoomBar.UPDATE)\n\n\t\t\tObject.keys(this.children).forEach((childKey: any) => {\n\t\t\t\tconst child = this.children[childKey]\n\t\t\t\tchild.margins = this.margins\n\t\t\t})\n\n\t\t\tthis.render(true)\n\t\t}\n\t}\n}\n","import { arc, easeLinear, scaleLinear, type ScaleLinear, type Selection } from 'd3'\nimport { getProperty } from '@/tools'\nimport { pie as pieConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { Skeletons, CartesianOrientations, Alignments } from '@/interfaces/enums'\n\nexport class Skeleton extends Component {\n\ttype = 'skeleton'\n\txScale: ScaleLinear<number, number>\n\tyScale: ScaleLinear<number, number>\n\tbackdrop: Selection<SVGElement | HTMLDivElement, unknown, Element, any>\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\tconst isDataLoading = getProperty(this.getOptions(), 'data', 'loading')\n\n\t\t// display a skeleton if there is no chart data or the loading flag is set to true\n\t\tif (isDataLoading) {\n\t\t\tthis.renderSkeleton(isDataLoading)\n\t\t} else {\n\t\t\tthis.removeSkeleton()\n\t\t}\n\t}\n\n\trenderSkeleton(showShimmerEffect: boolean) {\n\t\tif (this.configs.skeleton === Skeletons.GRID) {\n\t\t\tthis.renderGridSkeleton(showShimmerEffect)\n\t\t} else if (this.configs.skeleton === Skeletons.VERT_OR_HORIZ) {\n\t\t\tthis.renderVertOrHorizSkeleton(showShimmerEffect)\n\t\t} else if (this.configs.skeleton === Skeletons.PIE) {\n\t\t\tthis.renderPieSkeleton(showShimmerEffect)\n\t\t} else if (this.configs.skeleton === Skeletons.DONUT) {\n\t\t\tthis.renderDonutSkeleton(showShimmerEffect)\n\t\t} else {\n\t\t\tthrow new Error(`\"${this.configs.skeleton}\" is not a valid Skeleton type.`)\n\t\t}\n\t}\n\n\trenderGridSkeleton(showShimmerEffect: boolean) {\n\t\tthis.setScales()\n\t\tthis.drawBackdrop(showShimmerEffect)\n\t\tthis.drawXGrid(showShimmerEffect)\n\t\tthis.drawYGrid(showShimmerEffect)\n\t\tif (showShimmerEffect) {\n\t\t\tthis.setShimmerEffect('shimmer-lines')\n\t\t}\n\t}\n\n\trenderVertOrHorizSkeleton(showShimmerEffect: boolean) {\n\t\tconst orientation = this.services.cartesianScales.getOrientation()\n\t\tthis.setScales()\n\t\tthis.drawBackdrop(showShimmerEffect)\n\t\tif (orientation === CartesianOrientations.VERTICAL) {\n\t\t\tthis.drawYGrid(showShimmerEffect)\n\t\t}\n\t\tif (orientation === CartesianOrientations.HORIZONTAL) {\n\t\t\tthis.drawXGrid(showShimmerEffect)\n\t\t}\n\n\t\tthis.setShimmerEffect('shimmer-lines')\n\t}\n\n\trenderPieSkeleton(showShimmerEffect: boolean) {\n\t\tconst outerRadius = this.computeOuterRadius()\n\t\tconst innerRadius = 0\n\t\tthis.drawRing(outerRadius, innerRadius, showShimmerEffect)\n\t\tif (showShimmerEffect) {\n\t\t\tthis.setShimmerEffect('shimmer-areas')\n\t\t}\n\t}\n\n\trenderDonutSkeleton(showShimmerEffect: boolean) {\n\t\tconst outerRadius = this.computeOuterRadius()\n\t\tconst innerRadius = this.computeInnerRadius()\n\t\tthis.drawRing(outerRadius, innerRadius, showShimmerEffect)\n\t\tif (showShimmerEffect) {\n\t\t\tthis.setShimmerEffect('shimmer-areas')\n\t\t}\n\t}\n\n\tsetScales() {\n\t\tconst xRange = this.services.cartesianScales.getMainXScale().range()\n\t\tconst yRange = this.services.cartesianScales.getMainYScale().range()\n\t\tthis.xScale = scaleLinear().domain([0, 1]).range(xRange)\n\t\tthis.yScale = scaleLinear().domain([0, 1]).range(yRange)\n\t}\n\n\tdrawBackdrop(showShimmerEffect: boolean) {\n\t\tconst svg = this.parent\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(svg as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tthis.backdrop = DOMUtils.appendOrSelect(svg, 'svg.chart-skeleton.DAII')\n\t\t\t.attr('width', width)\n\t\t\t.attr('height', height)\n\n\t\tconst backdropRect = DOMUtils.appendOrSelect(this.backdrop, 'rect.chart-skeleton-backdrop')\n\t\tbackdropRect.attr('width', '100%').attr('height', '100%')\n\n\t\tconst [xScaleStart] = this.xScale.range()\n\t\tconst [, yScaleStart] = this.yScale.range()\n\n\t\tthis.backdrop.merge(backdropRect).attr('x', xScaleStart).attr('y', yScaleStart)\n\n\t\tbackdropRect\n\t\t\t.classed('shimmer-effect-lines', showShimmerEffect)\n\t\t\t.classed('empty-state-lines', !showShimmerEffect)\n\t\t\t.style(\n\t\t\t\t'stroke',\n\t\t\t\tshowShimmerEffect\n\t\t\t\t\t? `url(#${this.services.domUtils.generateElementIDString(`shimmer-lines`)})`\n\t\t\t\t\t: null\n\t\t\t)\n\t}\n\n\tdrawXGrid(showShimmerEffect: boolean) {\n\t\tconst width = +this.backdrop.attr('width')\n\t\tconst ticksNumber = getProperty(this.getOptions(), 'grid', 'x', 'numberOfTicks')\n\t\tconst ticksValues = this.xScale.ticks(ticksNumber).map((d: any) => d * width)\n\n\t\tconst xGridG = DOMUtils.appendOrSelect(this.backdrop, 'g.x.skeleton')\n\t\tconst update = xGridG.selectAll('line').data(ticksValues)\n\t\tupdate\n\t\t\t.enter()\n\t\t\t.append('line')\n\t\t\t.merge(update as any)\n\t\t\t.attr('x1', (d: any) => d)\n\t\t\t.attr('x2', (d: any) => d)\n\t\t\t.attr('y1', 0)\n\t\t\t.attr('y2', '100%')\n\n\t\txGridG\n\t\t\t.selectAll('line')\n\t\t\t.classed('shimmer-effect-lines', showShimmerEffect)\n\t\t\t.classed('empty-state-lines', !showShimmerEffect)\n\t\t\t.style(\n\t\t\t\t'stroke',\n\t\t\t\tshowShimmerEffect\n\t\t\t\t\t? `url(#${this.services.domUtils.generateElementIDString(`shimmer-lines`)})`\n\t\t\t\t\t: null\n\t\t\t)\n\t}\n\n\tdrawYGrid(showShimmerEffect: boolean) {\n\t\tconst height = +this.backdrop.attr('height')\n\t\tconst width = this.backdrop.attr('width')\n\t\tconst ticksNumber = getProperty(this.getOptions(), 'grid', 'y', 'numberOfTicks')\n\t\tconst ticksValues = this.xScale.ticks(ticksNumber).map((d: any) => d * height)\n\n\t\tconst yGridG = DOMUtils.appendOrSelect(this.backdrop, 'g.y.skeleton')\n\t\tconst update = yGridG.selectAll('line').data(ticksValues)\n\t\tupdate\n\t\t\t.enter()\n\t\t\t.append('line')\n\t\t\t.merge(update as any)\n\t\t\t.attr('x1', 0)\n\t\t\t.attr('x2', width)\n\t\t\t.attr('y1', (d: any) => d)\n\t\t\t.attr('y2', (d: any) => d)\n\n\t\tyGridG\n\t\t\t.selectAll('line')\n\t\t\t.classed('shimmer-effect-lines', showShimmerEffect)\n\t\t\t.classed('empty-state-lines', !showShimmerEffect)\n\t\t\t.style(\n\t\t\t\t'stroke',\n\t\t\t\tshowShimmerEffect\n\t\t\t\t\t? `url(#${this.services.domUtils.generateElementIDString(`shimmer-lines`)})`\n\t\t\t\t\t: null\n\t\t\t)\n\t}\n\n\tdrawRing(outerRadius: number, innerRadius: number, shimmer = true) {\n\t\tconst svg = this.parent\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(svg as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tconst container = DOMUtils.appendOrSelect(svg, 'svg.chart-skeleton')\n\t\t\t.attr('width', width)\n\t\t\t.attr('height', height)\n\n\t\tconst optionName = innerRadius === 0 ? 'pie' : 'donut'\n\n\t\tconst alignment = getProperty(this.getOptions(), optionName, 'alignment')\n\n\t\tDOMUtils.appendOrSelect(container, 'rect.chart-skeleton-area-container')\n\t\t\t.attr('width', width)\n\t\t\t.attr('height', height)\n\t\t\t.attr('fill', 'none')\n\n\t\tconst arcPathGenerator = arc()\n\t\t\t.innerRadius(innerRadius)\n\t\t\t.outerRadius(outerRadius)\n\t\t\t.startAngle(0)\n\t\t\t.endAngle(Math.PI * 2)\n\n\t\t// centering circle inside the container\n\t\tconst tcx = outerRadius + Math.abs(pieConfigs.radiusOffset)\n\t\tconst tcy = outerRadius + (Math.min(width, height) - outerRadius * 2) / 2\n\n\t\tconst skeletonAreaShape = DOMUtils.appendOrSelect(container, 'path')\n\t\t\t.attr('class', 'skeleton-area-shape')\n\t\t\t.attr('transform', `translate(${tcx}, ${tcy})`)\n\t\t\t.attr('d', arcPathGenerator)\n\t\t\t.classed('shimmer-effect-areas', shimmer)\n\t\t\t.classed('empty-state-areas', !shimmer)\n\t\t\t.style(\n\t\t\t\t'fill',\n\t\t\t\tshimmer ? `url(#${this.services.domUtils.generateElementIDString(`shimmer-areas`)})` : null\n\t\t\t)\n\n\t\t// Position skeleton\n\t\tlet translateX = outerRadius + pieConfigs.xOffset\n\t\tif (alignment === Alignments.CENTER) {\n\t\t\ttranslateX = width / 2\n\t\t} else if (alignment === Alignments.RIGHT) {\n\t\t\ttranslateX = width - outerRadius - pieConfigs.xOffset\n\t\t}\n\n\t\tconst translateY = outerRadius + pieConfigs.yOffset\n\t\tskeletonAreaShape.attr('transform', `translate(${translateX}, ${translateY})`)\n\t}\n\n\t// same logic in pie\n\tcomputeOuterRadius() {\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(this.parent as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\t\tconst radius = Math.min(width, height) / 2\n\t\treturn radius + pieConfigs.radiusOffset\n\t}\n\n\t// same logic in donut\n\tcomputeInnerRadius() {\n\t\treturn this.computeOuterRadius() * (3 / 4)\n\t}\n\n\tsetShimmerEffect(gradientId: string) {\n\t\tconst animationDuration = 2000 // ms\n\t\tconst delay = 1000 // ms\n\t\tconst shimmerWidth = 0.2\n\t\tconst stopBgShimmerClass = 'stop-bg-shimmer'\n\t\tconst stopShimmerClass = 'stop-shimmer'\n\t\tconst container = this.parent.select('.chart-skeleton')\n\t\tconst { width } = DOMUtils.getSVGElementSize(this.parent as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\t\tconst startPoint = 0\n\t\tconst endPoint = width\n\n\t\t// append the defs as first child of container\n\t\tconst defs = DOMUtils.appendOrSelect(container as any, 'defs').lower()\n\t\tconst linearGradient = DOMUtils.appendOrSelect(defs, 'linearGradient')\n\t\t\t.attr('id', this.services.domUtils.generateElementIDString(gradientId))\n\t\t\t.attr('class', gradientId)\n\t\t\t.attr('x1', startPoint - 3 * shimmerWidth * width)\n\t\t\t.attr('x2', endPoint)\n\t\t\t.attr('y1', 0)\n\t\t\t.attr('y2', 0)\n\t\t\t.attr('gradientUnits', 'userSpaceOnUse')\n\t\t\t.attr('gradientTransform', `translate(0, 0)`)\n\t\tconst stops = `\n\t\t\t<stop class=\"${stopBgShimmerClass}\" offset=\"${startPoint}\"></stop>\n\t\t\t<stop class=\"${stopShimmerClass}\" offset=\"${startPoint + shimmerWidth}\"></stop>\n\t\t\t<stop class=\"${stopBgShimmerClass}\" offset=\"${startPoint + 2 * shimmerWidth}\"></stop>\n\t\t`\n\t\tlinearGradient.html(stops)\n\n\t\trepeat()\n\t\tfunction repeat() {\n\t\t\tlinearGradient\n\t\t\t\t.attr('gradientTransform', `translate(${startPoint - 3 * shimmerWidth * width}, 0)`)\n\t\t\t\t.transition()\n\t\t\t\t.duration(animationDuration)\n\t\t\t\t.delay(delay)\n\t\t\t\t.ease(easeLinear)\n\t\t\t\t.attr('gradientTransform', `translate(${endPoint + 3 * shimmerWidth * width}, 0)`)\n\t\t\t\t.on('end', repeat)\n\t\t}\n\t}\n\n\tremoveSkeleton() {\n\t\tconst container = this.parent.select('.chart-skeleton')\n\t\tcontainer.remove()\n\t}\n}\n","import { cloneDeep } from 'lodash-es'\nimport { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { AreaChartOptions } from '@/interfaces/charts'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { Area } from '@/components/graphs/area'\nimport { Line } from '@/components/graphs/line'\nimport { Ruler } from '@/components/axes/ruler'\nimport { Scatter } from '@/components/graphs/scatter'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { Skeleton } from '@/components/graphs/skeleton'\n\nexport class AreaChart extends AxisChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<AreaChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(\n\t\t\tmergeDefaultChartOptions(cloneDeep(options.areaChart), chartConfigs.options)\n\t\t)\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew Ruler(this.model, this.services),\n\t\t\tnew Line(this.model, this.services),\n\t\t\tnew Area(this.model, this.services),\n\t\t\tnew Scatter(this.model, this.services, {\n\t\t\t\tfadeInOnChartHolderMouseover: true,\n\t\t\t\thandleThresholds: true\n\t\t\t}),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.GRID\n\t\t\t})\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { ascending, min, max, quantile, scaleOrdinal } from 'd3'\nimport { getProperty } from '@/tools'\nimport { color as colorConfigs } from '@/configuration'\nimport { ChartModelCartesian } from './cartesian-charts'\n\n/** The charting model layer which includes mainly the chart data and options,\n * as well as some misc. information to be shared among components */\nexport class BoxplotChartModel extends ChartModelCartesian {\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\tgetBoxQuartiles(d: any) {\n\t\treturn {\n\t\t\tq_25: quantile(d, 0.25),\n\t\t\tq_50: quantile(d, 0.5),\n\t\t\tq_75: quantile(d, 0.75)\n\t\t}\n\t}\n\n\tgetBoxplotData() {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst groupedData = this.getGroupedData()\n\n\t\t// Prepare the data for the box plots\n\t\tconst boxplotData = []\n\t\tfor (const { name: group, data } of groupedData) {\n\t\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier()\n\t\t\tconst values = data.map((d: any) => d[rangeIdentifier]).sort(ascending)\n\n\t\t\tconst record = {\n\t\t\t\t[groupMapsTo]: group,\n\t\t\t\tcounts: values,\n\t\t\t\tquartiles: this.getBoxQuartiles(values),\n\t\t\t\toutliers: null as any,\n\t\t\t\twhiskers: null as any\n\t\t\t}\n\n\t\t\tconst q1 = record.quartiles.q_25\n\t\t\tconst q3 = record.quartiles.q_75\n\n\t\t\tconst iqr = (q3 - q1) * 1.5\n\t\t\tconst irq1 = q1 - iqr\n\t\t\tconst irq3 = q3 + iqr\n\n\t\t\tconst outliers = []\n\t\t\tconst normalValues = []\n\n\t\t\tfor (const value of values) {\n\t\t\t\tif (value < irq1) {\n\t\t\t\t\toutliers.push(value)\n\t\t\t\t} else if (value > irq3) {\n\t\t\t\t\toutliers.push(value)\n\t\t\t\t} else {\n\t\t\t\t\tnormalValues.push(value)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\trecord.outliers = outliers\n\n\t\t\tconst minNormalValue = min(normalValues)\n\t\t\tconst maxNormalValue = max(normalValues)\n\t\t\trecord.whiskers = {\n\t\t\t\tmin: minNormalValue\n\t\t\t\t\t? minNormalValue\n\t\t\t\t\t: min([record.quartiles.q_25, record.quartiles.q_50, record.quartiles.q_75]),\n\t\t\t\tmax: maxNormalValue\n\t\t\t\t\t? maxNormalValue\n\t\t\t\t\t: max([record.quartiles.q_25, record.quartiles.q_50, record.quartiles.q_75])\n\t\t\t}\n\n\t\t\tboxplotData.push(record)\n\t\t}\n\n\t\treturn boxplotData\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst boxplotData = this.getBoxplotData()\n\n\t\tconst headers = ['Group', 'Minimum', 'Q1', 'Median', 'Q3', 'Maximum', 'IQR', 'Outlier(s)']\n\t\tconst cells = [\n\t\t\t...boxplotData.map(datum => {\n\t\t\t\tlet outliers = getProperty(datum, 'outliers')\n\t\t\t\tif (outliers === null || outliers.length === 0) {\n\t\t\t\t\toutliers = ['–']\n\t\t\t\t}\n\t\t\t\treturn [\n\t\t\t\t\tdatum[groupMapsTo],\n\t\t\t\t\tgetProperty(datum, 'whiskers', 'min') !== null\n\t\t\t\t\t\t? getProperty(datum, 'whiskers', 'min').toLocaleString()\n\t\t\t\t\t\t: '–',\n\t\t\t\t\tgetProperty(datum, 'quartiles', 'q_25') !== null\n\t\t\t\t\t\t? getProperty(datum, 'quartiles', 'q_25').toLocaleString()\n\t\t\t\t\t\t: '–',\n\t\t\t\t\tgetProperty(datum, 'quartiles', 'q_50') !== null\n\t\t\t\t\t\t? getProperty(datum, 'quartiles', 'q_50').toLocaleString()\n\t\t\t\t\t\t: '–',\n\t\t\t\t\tgetProperty(datum, 'quartiles', 'q_75') !== null\n\t\t\t\t\t\t? getProperty(datum, 'quartiles', 'q_75').toLocaleString()\n\t\t\t\t\t\t: '–',\n\t\t\t\t\tgetProperty(datum, 'whiskers', 'max') !== null\n\t\t\t\t\t\t? getProperty(datum, 'whiskers', 'max').toLocaleString()\n\t\t\t\t\t\t: '–',\n\t\t\t\t\tgetProperty(datum, 'quartiles', 'q_75') !== null &&\n\t\t\t\t\tgetProperty(datum, 'quartiles', 'q_25') !== null\n\t\t\t\t\t\t? (\n\t\t\t\t\t\t\t\tgetProperty(datum, 'quartiles', 'q_75') - getProperty(datum, 'quartiles', 'q_25')\n\t\t\t\t\t\t ).toLocaleString()\n\t\t\t\t\t\t: '–',\n\t\t\t\t\toutliers.map((d: any) => d.toLocaleString()).join(',')\n\t\t\t\t]\n\t\t\t})\n\t\t]\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n\n\tprotected setColorClassNames() {\n\t\t// monochrome\n\t\tconst numberOfColors = 1\n\n\t\tconst colorPairingOptions = getProperty(this.getOptions(), 'color', 'pairing')\n\t\tlet pairingOption = getProperty(colorPairingOptions, 'option')\n\t\tconst colorPairingCounts = colorConfigs.pairingOptions\n\n\t\t// Use default palette if user choice is not in range\n\t\tpairingOption =\n\t\t\tpairingOption <= colorPairingCounts[`${numberOfColors}-color`] ? pairingOption : 1\n\n\t\t// Create color classes for graph, tooltip and stroke use\n\t\tconst colorPairing = this.allDataGroups.map(() => `${numberOfColors}-${pairingOption}-1`)\n\n\t\t// Create default color classnames\n\t\tthis.colorClassNames = scaleOrdinal().range(colorPairing).domain(this.allDataGroups)\n\t}\n}\n","import { select } from 'd3'\nimport { flipDomainAndRangeBasedOnOrientation, generateSVGPathString } from '@/tools'\nimport { boxplot as boxplotConfigs } from '@/configuration'\nimport { BoxplotChartModel } from '@/model/boxplot'\nimport { Component } from '@/components/component'\nimport { CartesianOrientations, ColorClassNameTypes, Events, RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\n\nexport class Boxplot extends Component {\n\ttype = 'boxplot'\n\trenderType = RenderTypes.SVG\n\n\trender(animate: boolean) {\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true })\n\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst dataGroupNames = this.model.getDataGroupNames()\n\n\t\t/*\n\t\t * Get graphable dimensions\n\t\t */\n\t\tconst mainXScale = this.services.cartesianScales.getMainXScale()\n\t\tconst mainYScale = this.services.cartesianScales.getMainYScale()\n\t\tconst [xScaleStart, xScaleEnd] = mainXScale.range()\n\t\tconst [yScaleEnd, yScaleStart] = mainYScale.range()\n\t\tconst width = xScaleEnd - xScaleStart\n\t\tconst height = yScaleEnd - yScaleStart\n\t\tif (width === 0) {\n\t\t\treturn\n\t\t}\n\n\t\t// Get orientation of the chart\n\t\tconst { cartesianScales } = this.services\n\t\tconst orientation = cartesianScales.getOrientation()\n\t\tconst isInVerticalOrientation = orientation === CartesianOrientations.VERTICAL\n\t\tconst [getXValue, getYValue] = flipDomainAndRangeBasedOnOrientation(\n\t\t\t(d: any) => this.services.cartesianScales.getDomainValue(d),\n\t\t\t(d: any) => this.services.cartesianScales.getRangeValue(d),\n\t\t\torientation\n\t\t)\n\n\t\tconst gridSize = Math.floor((isInVerticalOrientation ? width : height) / dataGroupNames.length)\n\t\tconst boxWidth = Math.min(gridSize / 2, 16)\n\n\t\tconst boxplotData = (this.model as BoxplotChartModel).getBoxplotData()\n\n\t\t/*\n\t\t * update or initialize all box groups\n\t\t */\n\t\tconst boxGroups = svg.selectAll('.box-group').data(boxplotData)\n\t\tboxGroups.exit().remove()\n\n\t\tconst boxGroupsEnter = boxGroups.enter().append('g').attr('class', 'box-group')\n\n\t\tconst allBoxGroups = boxGroups.merge(boxGroupsEnter)\n\n\t\t/*\n\t\t * draw the 2 range lines for each box\n\t\t */\n\t\t// Start range line\n\t\tboxGroupsEnter\n\t\t\t.append('path')\n\t\t\t.merge(boxGroups.select('path.vertical-line.start'))\n\t\t\t.attr('class', () =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\toriginalClassName: 'vertical-line start'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('stroke-width', boxplotConfigs.strokeWidth.default)\n\t\t\t.attr('fill', 'none')\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'boxplot-update-verticalstartline',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\tconst x0 = cartesianScales.getDomainValue(d[groupMapsTo])\n\t\t\t\tconst x1 = x0\n\t\t\t\tconst y0 = cartesianScales.getRangeValue(d.whiskers.min)\n\t\t\t\tconst y1 = cartesianScales.getRangeValue(d.quartiles.q_25)\n\n\t\t\t\treturn generateSVGPathString({ x0, x1, y0, y1 }, orientation)\n\t\t\t})\n\n\t\t// End range line\n\t\tboxGroupsEnter\n\t\t\t.append('path')\n\t\t\t.merge(boxGroups.select('path.vertical-line.end'))\n\t\t\t.attr('class', () =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\toriginalClassName: 'vertical-line end'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('stroke-width', boxplotConfigs.strokeWidth.default)\n\t\t\t.attr('fill', 'none')\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'boxplot-update-verticalendline',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\tconst x0 = cartesianScales.getDomainValue(d[groupMapsTo])\n\t\t\t\tconst x1 = x0\n\t\t\t\tconst y0 = cartesianScales.getRangeValue(d.whiskers.max)\n\t\t\t\tconst y1 = cartesianScales.getRangeValue(d.quartiles.q_75)\n\n\t\t\t\treturn generateSVGPathString({ x0, x1, y0, y1 }, orientation)\n\t\t\t})\n\n\t\t/*\n\t\t * Draw out and update the boxes\n\t\t */\n\t\tboxGroupsEnter\n\t\t\t.append('path')\n\t\t\t.merge(boxGroups.select('path.box'))\n\t\t\t.attr('class', () =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL, ColorClassNameTypes.STROKE],\n\t\t\t\t\toriginalClassName: 'box'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('fill-opacity', boxplotConfigs.box.opacity.default)\n\t\t\t.attr('stroke-width', boxplotConfigs.strokeWidth.default)\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'box')\n\t\t\t.attr('aria-label', (d: any) => d[groupMapsTo])\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'boxplot-update-quartiles',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\tconst x0 = cartesianScales.getDomainValue(d[groupMapsTo]) - boxWidth / 2\n\t\t\t\tconst x1 = x0 + boxWidth\n\t\t\t\tconst y0 = cartesianScales.getRangeValue(\n\t\t\t\t\tMath[isInVerticalOrientation ? 'max' : 'min'](d.quartiles.q_75, d.quartiles.q_25)\n\t\t\t\t)\n\t\t\t\tconst y1 =\n\t\t\t\t\ty0 +\n\t\t\t\t\tMath.abs(\n\t\t\t\t\t\tcartesianScales.getRangeValue(d.quartiles.q_75) -\n\t\t\t\t\t\t\tcartesianScales.getRangeValue(d.quartiles.q_25)\n\t\t\t\t\t)\n\n\t\t\t\treturn generateSVGPathString({ x0, x1, y0, y1 }, orientation)\n\t\t\t})\n\n\t\t/*\n\t\t * Draw out and update highlight areas\n\t\t */\n\t\tboxGroupsEnter\n\t\t\t.append('path')\n\t\t\t.merge(boxGroups.select('path.highlight-area'))\n\t\t\t.attr('class', 'highlight-area')\n\t\t\t.attr('opacity', 0)\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\tconst x0 = cartesianScales.getDomainValue(d[groupMapsTo]) - boxWidth / 2\n\t\t\t\tconst x1 = x0 + boxWidth\n\t\t\t\tconst y0 = cartesianScales.getRangeValue(d.whiskers.min)\n\t\t\t\tconst y1 = cartesianScales.getRangeValue(d.whiskers.max)\n\n\t\t\t\treturn generateSVGPathString({ x0, x1, y0, y1 }, orientation)\n\t\t\t})\n\n\t\t/*\n\t\t * Draw out and update the starting whisker\n\t\t */\n\t\tboxGroupsEnter\n\t\t\t.append('path')\n\t\t\t.merge(boxGroups.select('path.whisker.start'))\n\t\t\t.attr('class', () =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\toriginalClassName: 'whisker start'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('stroke-width', boxplotConfigs.strokeWidth.thicker)\n\t\t\t.attr('fill', 'none')\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'boxplot-update-startingwhisker',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\tconst x0 = cartesianScales.getDomainValue(d[groupMapsTo]) - boxWidth / 4\n\t\t\t\tconst x1 = x0 + boxWidth / 2\n\t\t\t\tconst y0 = cartesianScales.getRangeValue(d.whiskers.min)\n\t\t\t\tconst y1 = cartesianScales.getRangeValue(d.whiskers.min)\n\n\t\t\t\treturn generateSVGPathString({ x0, x1, y0, y1 }, orientation)\n\t\t\t})\n\n\t\t/*\n\t\t * Draw out and update the median line\n\t\t */\n\t\tboxGroupsEnter\n\t\t\t.append('path')\n\t\t\t.merge(boxGroups.select('path.median'))\n\t\t\t.attr('fill', 'none')\n\t\t\t.attr('class', () =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\toriginalClassName: 'median'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('stroke-width', 2)\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'boxplot-update-median',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\tconst x0 = cartesianScales.getDomainValue(d[groupMapsTo]) - boxWidth / 2\n\t\t\t\tconst x1 = x0 + boxWidth\n\t\t\t\tconst y0 = cartesianScales.getRangeValue(d.quartiles.q_50)\n\t\t\t\tconst y1 = y0\n\n\t\t\t\treturn generateSVGPathString({ x0, x1, y0, y1 }, orientation)\n\t\t\t})\n\n\t\t/*\n\t\t * Draw out and update the ending whisker\n\t\t */\n\t\tboxGroupsEnter\n\t\t\t.append('path')\n\t\t\t.merge(boxGroups.select('path.whisker.end'))\n\t\t\t.attr('class', () =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\toriginalClassName: 'whisker end'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('stroke-width', boxplotConfigs.strokeWidth.thicker)\n\t\t\t.attr('fill', 'none')\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'boxplot-update-endingwhisker',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\tconst x0 = cartesianScales.getDomainValue(d[groupMapsTo]) - boxWidth / 4\n\t\t\t\tconst x1 = x0 + boxWidth / 2\n\t\t\t\tconst y0 = cartesianScales.getRangeValue(d.whiskers.max)\n\t\t\t\tconst y1 = cartesianScales.getRangeValue(d.whiskers.max)\n\n\t\t\t\treturn generateSVGPathString({ x0, x1, y0, y1 }, orientation)\n\t\t\t})\n\n\t\t/*\n\t\t * Draw out and update the outlier circles\n\t\t */\n\t\tconst circles = allBoxGroups.selectAll('circle.outlier').data((d: any) =>\n\t\t\td.outliers.map((outlier: any) => {\n\t\t\t\treturn {\n\t\t\t\t\tmin: d.whiskers.min,\n\t\t\t\t\tmax: d.whiskers.max,\n\t\t\t\t\t[groupMapsTo]: d[groupMapsTo],\n\t\t\t\t\tvalue: outlier\n\t\t\t\t}\n\t\t\t})\n\t\t)\n\n\t\tcircles.exit().remove()\n\n\t\tconst circlesEnter = circles.enter().append('circle')\n\n\t\tcircles\n\t\t\t.merge(circlesEnter)\n\t\t\t.attr('r', boxplotConfigs.circle.radius)\n\t\t\t.attr('class', () =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL, ColorClassNameTypes.STROKE],\n\t\t\t\t\toriginalClassName: 'outlier'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('fill-opacity', boxplotConfigs.circle.opacity.default)\n\t\t\t.attr('cx', getXValue)\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'boxplot-update-circles',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('cy', getYValue)\n\n\t\tthis.addBoxEventListeners()\n\t\tthis.addCircleEventListeners()\n\t}\n\n\taddBoxEventListeners() {\n\t\tconst self = this\n\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tthis.parent\n\t\t\t.selectAll('path.highlight-area')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\tconst parentElement = select((this as any).parentNode)\n\t\t\t\tparentElement\n\t\t\t\t\t.select('path.box')\n\t\t\t\t\t.classed('hovered', true)\n\t\t\t\t\t.attr('fill-opacity', boxplotConfigs.box.opacity.hovered)\n\n\t\t\t\t// Show tooltip for single datapoint\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: options.tooltip.groupLabel,\n\t\t\t\t\t\t\tvalue: datum[groupMapsTo],\n\t\t\t\t\t\t\tclass: self.model.getColorClassName({\n\t\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.TOOLTIP]\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Minimum',\n\t\t\t\t\t\t\tvalue: datum.whiskers.min\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Q1',\n\t\t\t\t\t\t\tvalue: datum.quartiles.q_25\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Median',\n\t\t\t\t\t\t\tvalue: datum.quartiles.q_50\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Q3',\n\t\t\t\t\t\t\tvalue: datum.quartiles.q_75\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Maximum',\n\t\t\t\t\t\t\tvalue: datum.whiskers.max\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'IQR',\n\t\t\t\t\t\t\tvalue: datum.quartiles.q_75 - datum.quartiles.q_25\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t})\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Boxplot.BOX_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Boxplot.BOX_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Boxplot.BOX_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\tconst parentElement = select((this as any).parentNode)\n\t\t\t\tparentElement\n\t\t\t\t\t.select('path.box')\n\t\t\t\t\t.classed('hovered', false)\n\t\t\t\t\t.attr('fill-opacity', boxplotConfigs.box.opacity.default)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Boxplot.BOX_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\taddCircleEventListeners() {\n\t\tconst self = this\n\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier()\n\n\t\tthis.parent\n\t\t\t.selectAll('circle')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\thoveredElement\n\t\t\t\t\t.classed('hovered', true)\n\t\t\t\t\t.attr('fill-opacity', boxplotConfigs.circle.opacity.hovered)\n\t\t\t\t\t.classed('unfilled', false)\n\n\t\t\t\t// Show tooltip for single datapoint\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: options.tooltip.groupLabel,\n\t\t\t\t\t\t\tvalue: datum[groupMapsTo],\n\t\t\t\t\t\t\tclass: self.model.getColorClassName({\n\t\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.TOOLTIP]\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Outlier',\n\t\t\t\t\t\t\tvalue: datum[rangeIdentifier]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t})\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Boxplot.OUTLIER_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Boxplot.OUTLIER_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Boxplot.OUTLIER_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement\n\t\t\t\t\t.classed('hovered', false)\n\t\t\t\t\t.attr('fill-opacity', boxplotConfigs.circle.opacity.default)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Boxplot.OUTLIER_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n","import { flipSVGCoordinatesBasedOnOrientation } from '@/tools'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { RenderTypes } from '@/interfaces/enums'\n\nexport class ZeroLine extends Component {\n\ttype = 'zero-line'\n\trenderType = RenderTypes.SVG\n\n\trender(animate: boolean) {\n\t\tconst axisPosition = this.services.cartesianScales.getRangeAxisPosition({\n\t\t\tgroups: this.configs.groups\n\t\t})\n\t\tconst rangeScale = this.services.cartesianScales.getScaleByPosition(axisPosition)\n\t\t// check the domain\n\t\tconst [minDomainValue, maxDomainValue] = rangeScale.domain()\n\n\t\tconst drawZeroLine =\n\t\t\t(minDomainValue > 0 && maxDomainValue < 0) || (minDomainValue < 0 && maxDomainValue > 0)\n\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer()\n\n\t\t// show zero line only if is necessary, otherwise make sure tto remove zero line if the chart\n\t\t// previously had a domain that went into negatives\n\t\tif (!drawZeroLine) {\n\t\t\t// otherwise if a chart draws a zero line and then the domain change the zero line is still in the DOM\n\t\t\tsvg.selectAll('line.domain').remove()\n\t\t\treturn\n\t\t}\n\n\t\t// Get x & y position of the line\n\t\tconst [x0, x1] = this.services.cartesianScales.getDomainScale().range()\n\t\tlet yPosition = +rangeScale(0) + 0.5\n\n\t\t// if scale domain contains NaN, return the first value of the range\n\t\t// this is necessary for the zero line y position that otherwise is NaN\n\t\t// so on the top of the chart while we want it on the bottom\n\t\tif (!yPosition) {\n\t\t\tyPosition = rangeScale.range()[0]\n\t\t}\n\n\t\tconst lineCoordinates = flipSVGCoordinatesBasedOnOrientation(\n\t\t\t{\n\t\t\t\tx0,\n\t\t\t\tx1,\n\t\t\t\ty0: yPosition,\n\t\t\t\ty1: yPosition\n\t\t\t},\n\t\t\tthis.services.cartesianScales.getOrientation()\n\t\t)\n\n\t\tconst line = DOMUtils.appendOrSelect(svg, 'line.domain')\n\t\tline\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'zero-line-update',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('y1', lineCoordinates.y0)\n\t\t\t.attr('y2', lineCoordinates.y1)\n\t\t\t.attr('x1', lineCoordinates.x0)\n\t\t\t.attr('x2', lineCoordinates.x1)\n\t}\n}\n","import { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport { BoxplotChartModel } from '@/model/boxplot'\nimport type { BoxplotChartOptions } from '@/interfaces/charts'\nimport type { ChartConfig } from '@/interfaces/model'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { Boxplot } from '@/components/graphs/boxplot'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { ZeroLine } from '@/components/axes/zero-line'\nimport { Skeleton } from '@/components/graphs/skeleton'\n\nexport class BoxplotChart extends AxisChart {\n\tmodel = new BoxplotChartModel(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<BoxplotChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.boxplotChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew Boxplot(this.model, this.services),\n\t\t\tnew ZeroLine(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.VERT_OR_HORIZ\n\t\t\t})\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents, {\n\t\t\tlegend: {\n\t\t\t\tenabled: false\n\t\t\t}\n\t\t})\n\t\treturn components\n\t}\n}\n","import { extent, scaleLinear, type Selection } from 'd3'\nimport { flipDomainAndRangeBasedOnOrientation, getProperty } from '@/tools'\nimport { Scatter } from './scatter'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { ColorClassNameTypes, RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\n\nexport class Bubble extends Scatter {\n\ttype = 'bubble'\n\trenderType = RenderTypes.SVG\n\n\tgetRadiusScale(selection: Selection<any, any, any, any>) {\n\t\tconst options = this.getOptions()\n\t\tconst { radiusMapsTo } = options.bubble\n\n\t\tconst data = selection.data()\n\t\t// Filter out any null/undefined values\n\t\tconst allRadii = data.map((d: any) => d[radiusMapsTo]).filter(radius => radius)\n\t\tconst chartSize = DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer())\n\n\t\t// We need the ternary operator here in case the user\n\t\t// doesn't provide radius values in data\n\t\tconst radiusDataIsValid = allRadii.length > 0\n\t\tconst domain = radiusDataIsValid ? extent(allRadii) : [1, 1]\n\n\t\treturn scaleLinear()\n\t\t\t.domain(domain)\n\t\t\t.range(radiusDataIsValid ? options.bubble.radiusRange(chartSize, data) : [4, 4])\n\t}\n\n\tstyleCircles(selection: Selection<any, any, any, any>, animate: boolean) {\n\t\t// Chart options mixed with the internal configurations\n\t\tconst options = this.getOptions()\n\t\tconst { radiusMapsTo } = options.bubble\n\n\t\tconst radiusScale = this.getRadiusScale(selection)\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst { cartesianScales } = this.services\n\t\tconst getDomainValue = (d: any) => cartesianScales.getDomainValue(d)\n\t\tconst getRangeValue = (d: any) => cartesianScales.getRangeValue(d)\n\t\tconst [getXValue, getYValue] = flipDomainAndRangeBasedOnOrientation(\n\t\t\tgetDomainValue,\n\t\t\tgetRangeValue,\n\t\t\tcartesianScales.getOrientation()\n\t\t)\n\n\t\tselection\n\t\t\t.raise()\n\t\t\t.classed('dot', true)\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-label', (d: any) => {\n\t\t\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier(d)\n\t\t\t\treturn d[rangeIdentifier]\n\t\t\t})\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'bubble-update-enter',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('cx', getXValue)\n\t\t\t.attr('cy', getYValue)\n\t\t\t// We need `|| 1` here in case the user doesn't provide radius values in data\n\t\t\t.attr('r', (d: any) => radiusScale(d[radiusMapsTo] || 1))\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL, ColorClassNameTypes.STROKE],\n\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\toriginalClassName: 'dot'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('fill', (d: any) => {\n\t\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(d)\n\t\t\t\treturn this.model.getFillColor(d[groupMapsTo], d[domainIdentifier], d)\n\t\t\t})\n\t\t\t.style('stroke', (d: any) => {\n\t\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(d)\n\t\t\t\treturn this.model.getStrokeColor(d[groupMapsTo], d[domainIdentifier], d)\n\t\t\t})\n\t\t\t.attr('fill-opacity', options.bubble.fillOpacity)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\tgetTooltipAdditionalItems(datum: any) {\n\t\tconst bubbleOptions = getProperty(this.getOptions(), 'bubble')\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tlabel: getProperty(bubbleOptions, 'radiusLabel'),\n\t\t\t\tvalue: datum[getProperty(bubbleOptions, 'radiusMapsTo')]\n\t\t\t}\n\t\t]\n\t}\n}\n","import { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { ChartConfig } from '@/interfaces/model'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { BubbleChartOptions } from '@/interfaces/charts'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { Ruler } from '@/components/axes/ruler'\nimport { Bubble } from '@/components/graphs/bubble'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { Skeleton } from '@/components/graphs/skeleton'\n\nexport class BubbleChart extends AxisChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<BubbleChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.bubbleChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew Ruler(this.model, this.services),\n\t\t\tnew Bubble(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.GRID\n\t\t\t})\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { getProperty } from '@/tools'\nimport { ChartModelCartesian } from './cartesian-charts'\n\n/**\n * Bullet chart model layer\n */\nexport class BulletChartModel extends ChartModelCartesian {\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\t/**\n\t * Determines the index of the performance area titles to use\n\t * @param datum\n\t * @returns number\n\t */\n\tgetMatchingRangeIndexForDatapoint(datum: any) {\n\t\tlet matchingRangeIndex\n\t\tfor (let i = datum.ranges.length - 1; i > 0; i--) {\n\t\t\tconst range = datum.ranges[i]\n\t\t\tif (datum.value >= range) {\n\t\t\t\tmatchingRangeIndex = i\n\n\t\t\t\treturn matchingRangeIndex\n\t\t\t}\n\t\t}\n\n\t\treturn 0\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier()\n\n\t\tconst performanceAreaTitles = getProperty(options, 'bullet', 'performanceAreaTitles')\n\t\tconst headers = ['Title', 'Group', 'Value', 'Target', 'Percentage', 'Performance']\n\t\tconst cells = [\n\t\t\t...displayData.map((datum: any) => [\n\t\t\t\tdatum['title'],\n\t\t\t\tdatum[groupMapsTo],\n\t\t\t\tdatum['value'] === null ? '–' : datum['value'],\n\t\t\t\tgetProperty(datum, 'marker') === null ? '–' : datum['marker'],\n\t\t\t\tgetProperty(datum, 'marker') === null\n\t\t\t\t\t? '–'\n\t\t\t\t\t: `${Math.floor((datum[rangeIdentifier] / datum.marker) * 100)}%`,\n\t\t\t\tperformanceAreaTitles[this.getMatchingRangeIndexForDatapoint(datum)]\n\t\t\t])\n\t\t]\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n}\n","import { select } from 'd3'\nimport { generateSVGPathString, getProperty } from '@/tools'\nimport { Component } from '@/components/component'\nimport { Events, ColorClassNameTypes, RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { BulletChartModel } from '@/model/bullet'\n\nexport class Bullet extends Component {\n\ttype = 'bullet'\n\trenderType = RenderTypes.SVG\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events\n\n\t\t// Highlight correct circle on legend item hovers\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\n\t\t// Un-highlight circles on legend item mouseouts\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate: boolean) {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true })\n\n\t\tconst data = this.model.getDisplayData(this.configs.groups)\n\n\t\tconst rangeScale = this.services.cartesianScales.getRangeScale()\n\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier()\n\t\tconst [rangeScaleStart, rangeScaleEnd] = rangeScale.range()\n\t\tconst [, rangeScaleDomainMax] = rangeScale.domain()\n\n\t\tconst renderRangeBoxes = () => {\n\t\t\tconst rangeBoxData: any[] = []\n\t\t\tdata.forEach((datum: any) => {\n\t\t\t\tif (datum.ranges) {\n\t\t\t\t\tdatum.ranges.forEach((range: any, i: number) => {\n\t\t\t\t\t\tif (range !== null && range !== undefined && range < rangeScaleDomainMax) {\n\t\t\t\t\t\t\trangeBoxData.push({\n\t\t\t\t\t\t\t\tdatum,\n\t\t\t\t\t\t\t\tvalue: range,\n\t\t\t\t\t\t\t\torder: i + 1\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\trangeBoxData.push({\n\t\t\t\t\t\tdatum,\n\t\t\t\t\t\torder: 1\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\n\t\t\t// Update data on all lines\n\t\t\tconst rangeBoxes = DOMUtils.appendOrSelect(svg, 'g.range-boxes')\n\t\t\t\t.selectAll('path.range-box')\n\t\t\t\t.data(rangeBoxData, (datum: any) => `${datum[groupMapsTo]}-${datum.order}`)\n\n\t\t\t// Remove lines that are no longer needed\n\t\t\trangeBoxes.exit().attr('opacity', 0).remove()\n\n\t\t\t// Add the paths that need to be introduced\n\t\t\tconst rangeBoxesEnter = rangeBoxes.enter().append('path').attr('opacity', 0)\n\n\t\t\trangeBoxesEnter\n\t\t\t\t.merge(rangeBoxes as any)\n\t\t\t\t.attr('class', (d: any) => `range-box order-${d.order}`)\n\t\t\t\t.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'bullet-range-box-update-enter',\n\t\t\t\t\t\tanimate\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.attr('d', (d: any) => {\n\t\t\t\t\t/*\n\t\t\t\t\t * Orientation support for horizontal/vertical bar charts\n\t\t\t\t\t * Determine coordinates needed for a vertical set of paths\n\t\t\t\t\t * to draw the bars needed, and pass those coordinates down to\n\t\t\t\t\t * generateSVGPathString() to decide whether it needs to flip them\n\t\t\t\t\t */\n\t\t\t\t\tconst lineHeight = 16\n\n\t\t\t\t\tlet x0: number, x1: number, y0: number, y1: number\n\t\t\t\t\tif (d.order === 1) {\n\t\t\t\t\t\tx0 = this.services.cartesianScales.getDomainValue(d.datum) - lineHeight / 2\n\t\t\t\t\t\tx1 = x0 + lineHeight\n\t\t\t\t\t\ty0 = rangeScaleEnd - 2\n\t\t\t\t\t\ty1 = rangeScaleStart + 1\n\t\t\t\t\t} else {\n\t\t\t\t\t\tx0 = this.services.cartesianScales.getDomainValue(d.datum) - lineHeight / 2\n\t\t\t\t\t\tx1 = x0 + lineHeight\n\t\t\t\t\t\ty0 = this.services.cartesianScales.getRangeValue(d.value)\n\t\t\t\t\t\ty1 = rangeScaleEnd\n\t\t\t\t\t}\n\n\t\t\t\t\treturn generateSVGPathString(\n\t\t\t\t\t\t{ x0, x1, y0, y1 },\n\t\t\t\t\t\tthis.services.cartesianScales.getOrientation()\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t\t.attr('opacity', 1)\n\t\t}\n\n\t\tconst renderBars = () => {\n\t\t\t// Update data on all bars\n\t\t\tconst bars = DOMUtils.appendOrSelect(svg, 'g.bars')\n\t\t\t\t.selectAll('path.bar')\n\t\t\t\t.data(data, (datum: any) => datum[groupMapsTo])\n\n\t\t\t// Remove bars that are no longer needed\n\t\t\tbars.exit().attr('opacity', 0).remove()\n\n\t\t\t// Add the paths that need to be introduced\n\t\t\tconst barsEnter = bars.enter().append('path').attr('opacity', 0)\n\n\t\t\tbarsEnter\n\t\t\t\t.merge(bars as any)\n\t\t\t\t.classed('bar', true)\n\t\t\t\t.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'bullet-bar-update-enter',\n\t\t\t\t\t\tanimate\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.attr('class', (d: any) =>\n\t\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\t\toriginalClassName: 'bar'\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.style('fill', (d: any) => this.model.getFillColor(d[groupMapsTo]))\n\t\t\t\t.attr('d', (d: any) => {\n\t\t\t\t\t/*\n\t\t\t\t\t * Orientation support for horizontal/vertical bar charts\n\t\t\t\t\t * Determine coordinates needed for a vertical set of paths\n\t\t\t\t\t * to draw the bars needed, and pass those coordinates down to\n\t\t\t\t\t * generateSVGPathString() to decide whether it needs to flip them\n\t\t\t\t\t */\n\t\t\t\t\tconst barWidth = 8\n\t\t\t\t\tconst x0 = this.services.cartesianScales.getDomainValue(d) - barWidth / 2\n\t\t\t\t\tconst x1 = x0 + barWidth\n\t\t\t\t\tconst y0 = this.services.cartesianScales.getRangeValue(0) + 1\n\t\t\t\t\tconst y1 = this.services.cartesianScales.getRangeValue(d)\n\n\t\t\t\t\treturn generateSVGPathString(\n\t\t\t\t\t\t{ x0, x1, y0, y1 },\n\t\t\t\t\t\tthis.services.cartesianScales.getOrientation()\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t\t.attr('opacity', 1)\n\t\t\t\t// a11y\n\t\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t\t.attr('aria-roledescription', 'bar')\n\t\t\t\t.attr('aria-label', (d: any) => d.value)\n\t\t}\n\n\t\tconst renderTargetLines = () => {\n\t\t\t// Update data on all lines\n\t\t\tconst lines = DOMUtils.appendOrSelect(svg, 'g.markers')\n\t\t\t\t.selectAll('path.marker')\n\t\t\t\t.data(\n\t\t\t\t\tdata.filter((d: any) => getProperty(d, 'marker') !== null),\n\t\t\t\t\t(datum: any) => datum[groupMapsTo]\n\t\t\t\t)\n\n\t\t\t// Remove lines that are no longer needed\n\t\t\tlines.exit().attr('opacity', 0).remove()\n\n\t\t\t// Add the paths that need to be introduced\n\t\t\tconst linesEnter = lines.enter().append('path').attr('opacity', 0)\n\n\t\t\tlinesEnter\n\t\t\t\t.merge(lines as any)\n\t\t\t\t.classed('marker', true)\n\t\t\t\t.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'bullet-marker-update-enter',\n\t\t\t\t\t\tanimate\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.attr('d', (d: any) => {\n\t\t\t\t\t/*\n\t\t\t\t\t * Orientation support for horizontal/vertical bar charts\n\t\t\t\t\t * Determine coordinates needed for a vertical set of paths\n\t\t\t\t\t * to draw the bars needed, and pass those coordinates down to\n\t\t\t\t\t * generateSVGPathString() to decide whether it needs to flip them\n\t\t\t\t\t */\n\t\t\t\t\tconst lineHeight = 24\n\t\t\t\t\tconst x0 = this.services.cartesianScales.getDomainValue(d) - lineHeight / 2\n\t\t\t\t\tconst x1 = x0 + lineHeight\n\t\t\t\t\tconst y0 = this.services.cartesianScales.getRangeValue(d.marker)\n\t\t\t\t\tconst y1 = y0\n\n\t\t\t\t\treturn generateSVGPathString(\n\t\t\t\t\t\t{ x0, x1, y0, y1 },\n\t\t\t\t\t\tthis.services.cartesianScales.getOrientation()\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t\t.attr('opacity', 1)\n\t\t}\n\n\t\tconst renderTargetQuartiles = () => {\n\t\t\tlet quartilesData: any[] = []\n\t\t\tdata\n\t\t\t\t.filter((d: any) => getProperty(d, 'marker') !== null)\n\t\t\t\t.forEach((d: any) => {\n\t\t\t\t\tconst value = d.marker\n\t\t\t\t\tconst barValue = d[rangeIdentifier]\n\n\t\t\t\t\tquartilesData = quartilesData.concat([\n\t\t\t\t\t\t{ datum: d, value: value * 0.25, barValue },\n\t\t\t\t\t\t{ datum: d, value: value * 0.5, barValue },\n\t\t\t\t\t\t{ datum: d, value: value * 0.75, barValue }\n\t\t\t\t\t])\n\t\t\t\t})\n\n\t\t\t// Update data on all lines\n\t\t\tconst lines = DOMUtils.appendOrSelect(svg, 'g.quartiles')\n\t\t\t\t.selectAll('path.quartile')\n\t\t\t\t.data(quartilesData, (datum: any) => datum[groupMapsTo])\n\n\t\t\t// Remove lines that are no longer needed\n\t\t\tlines.exit().attr('opacity', 0).remove()\n\n\t\t\t// Add the paths that need to be introduced\n\t\t\tconst linesEnter = lines.enter().append('path').attr('opacity', 0)\n\n\t\t\tlinesEnter\n\t\t\t\t.merge(lines as any)\n\t\t\t\t.attr('class', (d: any) => {\n\t\t\t\t\treturn `quartile ${d.value <= d.barValue ? 'over-bar' : ''}`\n\t\t\t\t})\n\t\t\t\t.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'bullet-quartile-update-enter',\n\t\t\t\t\t\tanimate\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.attr('d', ({ datum: d, value }: { datum: any; value: any }) => {\n\t\t\t\t\t/*\n\t\t\t\t\t * Orientation support for horizontal/vertical bar charts\n\t\t\t\t\t * Determine coordinates needed for a vertical set of paths\n\t\t\t\t\t * to draw the bars needed, and pass those coordinates down to\n\t\t\t\t\t * generateSVGPathString() to decide whether it needs to flip them\n\t\t\t\t\t */\n\t\t\t\t\tlet lineHeight = 4\n\t\t\t\t\t// if it lines up with a performance area border\n\t\t\t\t\t// make the line taller\n\t\t\t\t\tif (d.ranges && d.ranges.indexOf(value) !== -1) {\n\t\t\t\t\t\tlineHeight = 8\n\t\t\t\t\t}\n\n\t\t\t\t\tconst x0 = this.services.cartesianScales.getDomainValue(d) - lineHeight / 2\n\t\t\t\t\tconst x1 = x0 + lineHeight\n\t\t\t\t\tconst y0 = this.services.cartesianScales.getRangeValue(value)\n\t\t\t\t\tconst y1 = y0\n\n\t\t\t\t\treturn generateSVGPathString(\n\t\t\t\t\t\t{ x0, x1, y0, y1 },\n\t\t\t\t\t\tthis.services.cartesianScales.getOrientation()\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t\t.attr('opacity', 1)\n\t\t}\n\n\t\trenderRangeBoxes()\n\t\trenderBars()\n\t\trenderTargetLines()\n\t\trenderTargetQuartiles()\n\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners()\n\t}\n\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\t\tconst { groupMapsTo } = this.getOptions().data\n\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.transition('legend-hover-simple-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-simple-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => (d[groupMapsTo] !== hoveredElement.datum()['name'] ? 0.3 : 1))\n\t}\n\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.transition('legend-mouseout-simple-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-simple-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this\n\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier()\n\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', true)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tconst performanceAreaTitles = getProperty(options, 'bullet', 'performanceAreaTitles')\n\t\t\t\tconst matchingRangeIndex = (\n\t\t\t\t\tself.model as BulletChartModel\n\t\t\t\t).getMatchingRangeIndexForDatapoint(datum)\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: options.tooltip.groupLabel || 'Group',\n\t\t\t\t\t\t\tvalue: datum[groupMapsTo],\n\t\t\t\t\t\t\tclass: self.model.getColorClassName({\n\t\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.TOOLTIP],\n\t\t\t\t\t\t\t\tdataGroupName: datum[groupMapsTo]\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Value',\n\t\t\t\t\t\t\tvalue: datum[rangeIdentifier]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Target',\n\t\t\t\t\t\t\tvalue: datum.marker\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Percentage',\n\t\t\t\t\t\t\tvalue: `${Math.floor((datum[rangeIdentifier] / datum.marker) * 100)}%`\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Performance',\n\t\t\t\t\t\t\tvalue: performanceAreaTitles[matchingRangeIndex]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', false)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\tdestroy() {\n\t\t// Remove event listeners\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('mouseout', null)\n\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n}\n","import { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport { BulletChartModel } from '@/model/bullet'\nimport type { BulletChartOptions } from '@/interfaces/charts'\nimport type { ChartConfig } from '@/interfaces/model'\nimport { Skeletons } from '@/interfaces/enums'\nimport { Bullet } from '@/components/graphs/bullet'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { Skeleton } from '@/components/graphs/skeleton'\n\nexport class BulletChart extends AxisChart {\n\tmodel = new BulletChartModel(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<BulletChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.bulletChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew Bullet(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.GRID\n\t\t\t})\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { extent, scaleLinear, scaleQuantize } from 'd3'\nimport { isEmpty } from 'lodash-es'\nimport { getProperty } from '@/tools'\n\nexport function getDomain(data: any) {\n\tconst limits = extent(data, (d: any) => d.value)\n\tconst domain = scaleLinear()\n\t\t.domain(limits as [number, number])\n\t\t.nice()\n\t\t.domain()\n\n\t// Ensuring limits start at 0 to make scale look more `nicer`\n\tif (domain[0] > 0) {\n\t\tdomain[0] = 0\n\t} else if (domain[0] === 0 && domain[1] === 0) {\n\t\t// Range cannot be between 0 and 0 (itself)\n\t\treturn [0, 1]\n\t}\n\n\t// Ensure the median of the range is 0 if domain extends into both negative & positive\n\tif (domain[0] < 0 && domain[1] > 0) {\n\t\tif (Math.abs(domain[0]) > domain[1]) {\n\t\t\tdomain[1] = Math.abs(domain[0])\n\t\t} else {\n\t\t\tdomain[0] = -domain[1]\n\t\t}\n\t}\n\n\treturn domain\n}\n\nexport function getColorScale(displayData: any, colorOptions: any) {\n\tconst customColors = getProperty(colorOptions, 'gradient', 'colors')\n\tconst customColorsEnabled = !isEmpty(customColors)\n\n\tlet colorPairingOption = getProperty(colorOptions, 'pairing', 'option')\n\n\t// If domain consists of negative and positive values, use diverging palettes\n\tconst domain = getDomain(displayData)\n\tconst colorScheme = domain[0] < 0 && domain[1] > 0 ? 'diverge' : 'mono'\n\n\t// Use default color pairing options if not in defined range\n\tif (colorPairingOption < 1 && colorPairingOption > 4 && colorScheme === 'mono') {\n\t\tcolorPairingOption = 1\n\t} else if (colorPairingOption < 1 && colorPairingOption > 2 && colorScheme === 'diverge') {\n\t\tcolorPairingOption = 1\n\t}\n\n\t// Uses CSS classes for fill\n\tconst colorPairing = customColorsEnabled ? customColors : []\n\n\tif (!customColorsEnabled) {\n\t\t// Add class names to list and the amount based on the color scheme\n\t\t// Carbon charts has 11 colors for a single monochromatic palette & 17 for a divergent palette\n\t\tconst colorGroupingLength = colorScheme === 'diverge' ? 17 : 11\n\t\tfor (let i = 1; i < colorGroupingLength + 1; i++) {\n\t\t\tcolorPairing.push(`fill-${colorScheme}-${colorPairingOption}-${i}`)\n\t\t}\n\t}\n\n\t// Return generated color scale\n\treturn scaleQuantize()\n\t\t.domain(domain as [number, number])\n\t\t.range(colorPairing)\n}\n","// External Imports\nimport { isEmpty } from 'lodash-es'\n\n// Internal Imports\nimport { ChartModel } from './model'\nimport { getProperty } from '@/tools'\nimport { getColorScale } from '@/services/color-scale-utils'\n\n/**\n * Base thematic maps chart model layer\n */\nexport class ChoroplethModel extends ChartModel {\n\tprivate _colorScale: any = undefined\n\n\t// Holds a mapping of geometry objects to data objects\n\t// Allows us to access data faster\n\tprivate _matrix = {}\n\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\t/**\n\t * @override\n\t * @param value\n\t * @returns string\n\t */\n\tgetFillColor(value: number) {\n\t\treturn this._colorScale(value)\n\t}\n\n\t/**\n\t * Helper function that will generate a dictionary\n\t */\n\tgetCombinedData() {\n\t\tif (isEmpty(this._matrix)) {\n\t\t\tconst options = this.getOptions()\n\t\t\tconst data = this.getDisplayData()\n\t\t\tif (!isEmpty(data) && !isEmpty(options.geoData.objects.countries)) {\n\t\t\t\t/**\n\t\t\t\t * @todo\n\t\t\t\t * We can either use name or id by default to generate this dictionary\n\t\t\t\t * Curently id & name are standard in geoJSON. Unfortunately, topojson does not have any standard\n\t\t\t\t * so feature objects can have any key. We suggest that they include name or id at the very least\n\t\t\t\t *\n\t\t\t\t * May need to provide users with the option to pass in keys to create dictionary with\n\t\t\t\t */\n\t\t\t\toptions.geoData.objects.countries.geometries.forEach(country => {\n\t\t\t\t\tthis._matrix[country.properties.NAME] = country\n\t\t\t\t})\n\n\t\t\t\tdata.forEach(value => {\n\t\t\t\t\tif (this._matrix[value.name]) {\n\t\t\t\t\t\tthis._matrix[value.name]['value'] = value.value || null\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.warn(`Data point ${value} is missing geographical data.`)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\treturn this._matrix\n\t}\n\n\t/**\n\t * Generate tabular data from display data\n\t * @returns Array<Object>\n\t */\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\t\tconst headers = ['Country ID', 'Country Name', 'Value']\n\t\tconst cells = [\n\t\t\t...displayData.map(datum => [\n\t\t\t\tdatum['id'] === null ? '–' : datum['id'],\n\t\t\t\tdatum['name'],\n\t\t\t\tdatum['value']\n\t\t\t])\n\t\t]\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n\n\t// Uses quantize scale to return class names\n\tgetColorClassName(configs: { value?: number; originalClassName?: string }) {\n\t\treturn `${configs.originalClassName} ${this._colorScale(configs.value as number)}`\n\t}\n\n\tprotected setColorClassNames() {\n\t\tconst colorOptions = getProperty(this.getOptions(), 'color')\n\t\tthis._colorScale = getColorScale(this.getDisplayData(), colorOptions)\n\t}\n}\n","export default function(x) {\n return x;\n}\n","import identity from \"./identity.js\";\n\nexport default function(transform) {\n if (transform == null) return identity;\n var x0,\n y0,\n kx = transform.scale[0],\n ky = transform.scale[1],\n dx = transform.translate[0],\n dy = transform.translate[1];\n return function(input, i) {\n if (!i) x0 = y0 = 0;\n var j = 2, n = input.length, output = new Array(n);\n output[0] = (x0 += input[0]) * kx + dx;\n output[1] = (y0 += input[1]) * ky + dy;\n while (j < n) output[j] = input[j], ++j;\n return output;\n };\n}\n","export default function(array, n) {\n var t, j = array.length, i = j - n;\n while (i < --j) t = array[i], array[i++] = array[j], array[j] = t;\n}\n","import reverse from \"./reverse.js\";\nimport transform from \"./transform.js\";\n\nexport default function(topology, o) {\n if (typeof o === \"string\") o = topology.objects[o];\n return o.type === \"GeometryCollection\"\n ? {type: \"FeatureCollection\", features: o.geometries.map(function(o) { return feature(topology, o); })}\n : feature(topology, o);\n}\n\nfunction feature(topology, o) {\n var id = o.id,\n bbox = o.bbox,\n properties = o.properties == null ? {} : o.properties,\n geometry = object(topology, o);\n return id == null && bbox == null ? {type: \"Feature\", properties: properties, geometry: geometry}\n : bbox == null ? {type: \"Feature\", id: id, properties: properties, geometry: geometry}\n : {type: \"Feature\", id: id, bbox: bbox, properties: properties, geometry: geometry};\n}\n\nexport function object(topology, o) {\n var transformPoint = transform(topology.transform),\n arcs = topology.arcs;\n\n function arc(i, points) {\n if (points.length) points.pop();\n for (var a = arcs[i < 0 ? ~i : i], k = 0, n = a.length; k < n; ++k) {\n points.push(transformPoint(a[k], k));\n }\n if (i < 0) reverse(points, n);\n }\n\n function point(p) {\n return transformPoint(p);\n }\n\n function line(arcs) {\n var points = [];\n for (var i = 0, n = arcs.length; i < n; ++i) arc(arcs[i], points);\n if (points.length < 2) points.push(points[0]); // This should never happen per the specification.\n return points;\n }\n\n function ring(arcs) {\n var points = line(arcs);\n while (points.length < 4) points.push(points[0]); // This may happen if an arc has only two points.\n return points;\n }\n\n function polygon(arcs) {\n return arcs.map(ring);\n }\n\n function geometry(o) {\n var type = o.type, coordinates;\n switch (type) {\n case \"GeometryCollection\": return {type: type, geometries: o.geometries.map(geometry)};\n case \"Point\": coordinates = point(o.coordinates); break;\n case \"MultiPoint\": coordinates = o.coordinates.map(point); break;\n case \"LineString\": coordinates = line(o.arcs); break;\n case \"MultiLineString\": coordinates = o.arcs.map(line); break;\n case \"Polygon\": coordinates = polygon(o.arcs); break;\n case \"MultiPolygon\": coordinates = o.arcs.map(polygon); break;\n default: return null;\n }\n return {type: type, coordinates: coordinates};\n }\n\n return geometry(o);\n}\n","export default function(topology, arcs) {\n var stitchedArcs = {},\n fragmentByStart = {},\n fragmentByEnd = {},\n fragments = [],\n emptyIndex = -1;\n\n // Stitch empty arcs first, since they may be subsumed by other arcs.\n arcs.forEach(function(i, j) {\n var arc = topology.arcs[i < 0 ? ~i : i], t;\n if (arc.length < 3 && !arc[1][0] && !arc[1][1]) {\n t = arcs[++emptyIndex], arcs[emptyIndex] = i, arcs[j] = t;\n }\n });\n\n arcs.forEach(function(i) {\n var e = ends(i),\n start = e[0],\n end = e[1],\n f, g;\n\n if (f = fragmentByEnd[start]) {\n delete fragmentByEnd[f.end];\n f.push(i);\n f.end = end;\n if (g = fragmentByStart[end]) {\n delete fragmentByStart[g.start];\n var fg = g === f ? f : f.concat(g);\n fragmentByStart[fg.start = f.start] = fragmentByEnd[fg.end = g.end] = fg;\n } else {\n fragmentByStart[f.start] = fragmentByEnd[f.end] = f;\n }\n } else if (f = fragmentByStart[end]) {\n delete fragmentByStart[f.start];\n f.unshift(i);\n f.start = start;\n if (g = fragmentByEnd[start]) {\n delete fragmentByEnd[g.end];\n var gf = g === f ? f : g.concat(f);\n fragmentByStart[gf.start = g.start] = fragmentByEnd[gf.end = f.end] = gf;\n } else {\n fragmentByStart[f.start] = fragmentByEnd[f.end] = f;\n }\n } else {\n f = [i];\n fragmentByStart[f.start = start] = fragmentByEnd[f.end = end] = f;\n }\n });\n\n function ends(i) {\n var arc = topology.arcs[i < 0 ? ~i : i], p0 = arc[0], p1;\n if (topology.transform) p1 = [0, 0], arc.forEach(function(dp) { p1[0] += dp[0], p1[1] += dp[1]; });\n else p1 = arc[arc.length - 1];\n return i < 0 ? [p1, p0] : [p0, p1];\n }\n\n function flush(fragmentByEnd, fragmentByStart) {\n for (var k in fragmentByEnd) {\n var f = fragmentByEnd[k];\n delete fragmentByStart[f.start];\n delete f.start;\n delete f.end;\n f.forEach(function(i) { stitchedArcs[i < 0 ? ~i : i] = 1; });\n fragments.push(f);\n }\n }\n\n flush(fragmentByEnd, fragmentByStart);\n flush(fragmentByStart, fragmentByEnd);\n arcs.forEach(function(i) { if (!stitchedArcs[i < 0 ? ~i : i]) fragments.push([i]); });\n\n return fragments;\n}\n","import {object} from \"./feature.js\";\nimport stitch from \"./stitch.js\";\n\nfunction planarRingArea(ring) {\n var i = -1, n = ring.length, a, b = ring[n - 1], area = 0;\n while (++i < n) a = b, b = ring[i], area += a[0] * b[1] - a[1] * b[0];\n return Math.abs(area); // Note: doubled area!\n}\n\nexport default function(topology) {\n return object(topology, mergeArcs.apply(this, arguments));\n}\n\nexport function mergeArcs(topology, objects) {\n var polygonsByArc = {},\n polygons = [],\n groups = [];\n\n objects.forEach(geometry);\n\n function geometry(o) {\n switch (o.type) {\n case \"GeometryCollection\": o.geometries.forEach(geometry); break;\n case \"Polygon\": extract(o.arcs); break;\n case \"MultiPolygon\": o.arcs.forEach(extract); break;\n }\n }\n\n function extract(polygon) {\n polygon.forEach(function(ring) {\n ring.forEach(function(arc) {\n (polygonsByArc[arc = arc < 0 ? ~arc : arc] || (polygonsByArc[arc] = [])).push(polygon);\n });\n });\n polygons.push(polygon);\n }\n\n function area(ring) {\n return planarRingArea(object(topology, {type: \"Polygon\", arcs: [ring]}).coordinates[0]);\n }\n\n polygons.forEach(function(polygon) {\n if (!polygon._) {\n var group = [],\n neighbors = [polygon];\n polygon._ = 1;\n groups.push(group);\n while (polygon = neighbors.pop()) {\n group.push(polygon);\n polygon.forEach(function(ring) {\n ring.forEach(function(arc) {\n polygonsByArc[arc < 0 ? ~arc : arc].forEach(function(polygon) {\n if (!polygon._) {\n polygon._ = 1;\n neighbors.push(polygon);\n }\n });\n });\n });\n }\n }\n });\n\n polygons.forEach(function(polygon) {\n delete polygon._;\n });\n\n return {\n type: \"MultiPolygon\",\n arcs: groups.map(function(polygons) {\n var arcs = [], n;\n\n // Extract the exterior (unique) arcs.\n polygons.forEach(function(polygon) {\n polygon.forEach(function(ring) {\n ring.forEach(function(arc) {\n if (polygonsByArc[arc < 0 ? ~arc : arc].length < 2) {\n arcs.push(arc);\n }\n });\n });\n });\n\n // Stitch the arcs into one or more rings.\n arcs = stitch(topology, arcs);\n\n // If more than one ring is returned,\n // at most one of these rings can be the exterior;\n // choose the one with the greatest absolute area.\n if ((n = arcs.length) > 1) {\n for (var i = 1, k = area(arcs[0]), ki, t; i < n; ++i) {\n if ((ki = area(arcs[i])) > k) {\n t = arcs[0], arcs[0] = arcs[i], arcs[i] = t, k = ki;\n }\n }\n }\n\n return arcs;\n }).filter(function(arcs) {\n return arcs.length > 0;\n })\n };\n}\n","import { select, type Selection } from 'd3'\nimport { get, isEqual } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { Ruler } from './ruler'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { CartesianOrientations, ColorClassNameTypes, Events, RenderTypes } from '@/interfaces/enums'\n\nexport class BinnedRuler extends Ruler {\n\ttype = 'ruler-binned'\n\trenderType = RenderTypes.SVG\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tshowRuler(event: CustomEvent, [x, y]: [number, number]) {\n\t\tconst svg = this.parent\n\n\t\tconst options = this.model.getOptions()\n\t\tconst { cartesianScales } = this.services\n\n\t\tconst orientation: CartesianOrientations = cartesianScales.getOrientation()\n\n\t\tconst rangeScale = cartesianScales.getRangeScale()\n\t\tconst [yScaleEnd, yScaleStart] = rangeScale.range()\n\n\t\tconst domainScale = cartesianScales.getDomainScale()\n\n\t\tconst correspondingDomainValue = domainScale.invert(\n\t\t\torientation === CartesianOrientations.VERTICAL ? x : y\n\t\t)\n\n\t\tconst ruler = DOMUtils.appendOrSelect(svg, 'g.ruler').attr('aria-label', 'ruler')\n\t\tconst rulerLine = DOMUtils.appendOrSelect(ruler, 'line.ruler-line')\n\n\t\tconst dataPointElements = svg.selectAll('[role=graphics-symbol]') as Selection<\n\t\t\tSVGGraphicsElement,\n\t\t\tany,\n\t\t\tElement,\n\t\t\tany\n\t\t>\n\n\t\tconst elementsToHighlight = dataPointElements.filter((d: any) => {\n\t\t\tif (\n\t\t\t\tparseFloat(get(d, 'data.x0')) <= correspondingDomainValue &&\n\t\t\t\tparseFloat(get(d, 'data.x1')) >= correspondingDomainValue\n\t\t\t) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t})\n\n\t\t// some data point match\n\t\tif (elementsToHighlight.size() > 0) {\n\t\t\t/** if we pass from a trigger area to another one\n\t\t\t * mouseout on previous elements won't get dispatched\n\t\t\t * so we need to do it manually\n\t\t\t */\n\t\t\tif (\n\t\t\t\tthis.elementsToHighlight &&\n\t\t\t\tthis.elementsToHighlight.size() > 0 &&\n\t\t\t\t!isEqual(this.elementsToHighlight, elementsToHighlight)\n\t\t\t) {\n\t\t\t\tthis.hideRuler()\n\t\t\t}\n\n\t\t\telementsToHighlight.dispatch('mouseover')\n\n\t\t\t// set current hovered elements\n\t\t\tthis.elementsToHighlight = elementsToHighlight\n\n\t\t\tconst sampleMatchData = select(elementsToHighlight.nodes()[0]).datum()\n\n\t\t\tconst x0 = parseFloat(get(sampleMatchData, 'data.x0'))\n\t\t\tconst x1 = parseFloat(get(sampleMatchData, 'data.x1'))\n\n\t\t\tconst activeDataGroupNames = this.model.getActiveDataGroupNames()\n\n\t\t\tconst tooltipDataGroups = activeDataGroupNames\n\t\t\t\t.reverse()\n\t\t\t\t.map((dataGroupName: string) => ({\n\t\t\t\t\tlabel: dataGroupName,\n\t\t\t\t\tvalue: get(sampleMatchData, `data.${dataGroupName}`),\n\t\t\t\t\tclass: this.model.getColorClassName({\n\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.TOOLTIP],\n\t\t\t\t\t\tdataGroupName\n\t\t\t\t\t})\n\t\t\t\t}))\n\t\t\t\t.filter((d: any) => d.value !== 0)\n\t\t\tconst thereIsMatchingData = tooltipDataGroups.length > 0\n\n\t\t\tif (thereIsMatchingData) {\n\t\t\t\tthis.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tmousePosition: [x, y],\n\t\t\t\t\thoveredElement: rulerLine,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: get(options, 'bins.rangeLabel') || 'Range',\n\t\t\t\t\t\t\tvalue: `${x0} – ${x1}`\n\t\t\t\t\t\t},\n\t\t\t\t\t\t...tooltipDataGroups,\n\t\t\t\t\t\t...(getProperty(options, 'tooltip', 'showTotal') === true\n\t\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: get(options, 'tooltip.totalLabel') || 'Total',\n\t\t\t\t\t\t\t\t\t\tvalue: activeDataGroupNames.reduce(\n\t\t\t\t\t\t\t\t\t\t\t(accum: number, currentValue: any) =>\n\t\t\t\t\t\t\t\t\t\t\t\taccum + parseFloat(get(sampleMatchData, `data.${currentValue}`)),\n\t\t\t\t\t\t\t\t\t\t\t0\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t: [])\n\t\t\t\t\t]\n\t\t\t\t})\n\n\t\t\t\truler.attr('opacity', 1)\n\n\t\t\t\tconst rulerPosition = domainScale((x0 + x1) / 2)\n\n\t\t\t\t// line snaps to matching point\n\t\t\t\tif (orientation === 'horizontal') {\n\t\t\t\t\trulerLine\n\t\t\t\t\t\t.attr('x1', yScaleStart)\n\t\t\t\t\t\t.attr('x2', yScaleEnd)\n\t\t\t\t\t\t.attr('y1', rulerPosition)\n\t\t\t\t\t\t.attr('y2', rulerPosition)\n\t\t\t\t} else {\n\t\t\t\t\trulerLine\n\t\t\t\t\t\t.attr('y1', yScaleStart)\n\t\t\t\t\t\t.attr('y2', yScaleEnd)\n\t\t\t\t\t\t.attr('x1', rulerPosition)\n\t\t\t\t\t\t.attr('x2', rulerPosition)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.hideRuler()\n\t\t\t}\n\t\t} else {\n\t\t\tthis.hideRuler()\n\t\t}\n\t}\n}\n","import { Ruler } from './ruler'\n\nexport class StackedRuler extends Ruler {\n\tformatTooltipData(tooltipData: any) {\n\t\treturn tooltipData.reverse()\n\t}\n}\n","import { axisBottom, interpolateNumber, quantize, scaleBand, scaleLinear } from 'd3'\nimport { isEmpty } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { legend as legendConfigs } from '@/configuration'\nimport { ColorLegendType, Events, RenderTypes } from '@/interfaces/enums'\nimport { Legend } from './legend'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { getDomain } from '@/services/color-scale-utils'\nimport type { ChartModel } from '@/model'\n\nexport class ColorScaleLegend extends Legend {\n\ttype = 'color-legend'\n\trenderType = RenderTypes.SVG\n\n\tprivate gradient_id = `gradient-id-${Math.floor(Math.random() * 99999999999)}`\n\tprivate chartType: string\n\n\tconstructor(model: ChartModel, services: any, configs?: any) {\n\t\tsuper(model, services, configs)\n\t\tthis.chartType = configs.chartType\n\t}\n\n\tinit() {\n\t\t// Highlight correct circle on legend item hovers\n\t\tif (this.chartType === 'heatmap') {\n\t\t\tconst eventsFragment = this.services.events\n\t\t\teventsFragment.addEventListener(Events.Axis.RENDER_COMPLETE, this.handleAxisCompleteEvent)\n\t\t}\n\t}\n\n\t// Position legend after axis have rendered\n\thandleAxisCompleteEvent = () => {\n\t\tconst svg = this.getComponentContainer()\n\n\t\tconst { width } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tconst isDataLoading = getProperty(this.getOptions(), 'data', 'loading')\n\n\t\tif (width > legendConfigs.color.barWidth && !isDataLoading) {\n\t\t\tconst title = getProperty(this.getOptions(), 'heatmap', 'colorLegend', 'title')\n\n\t\t\tconst { cartesianScales } = this.services\n\n\t\t\t// Get axis width & start/end positions\n\t\t\tconst mainXScale = cartesianScales.getMainXScale()\n\t\t\tconst xDimensions = mainXScale.range()\n\n\t\t\t// Align legend with the axis\n\t\t\tif (xDimensions[0] > 1) {\n\t\t\t\tsvg.select('g.legend').attr('transform', `translate(${xDimensions[0]}, 0)`)\n\n\t\t\t\tif (title) {\n\t\t\t\t\tconst { width: textWidth } = DOMUtils.getSVGElementSize(\n\t\t\t\t\t\tsvg.select('g.legend-title').select('text'),\n\t\t\t\t\t\t{ useBBox: true }\n\t\t\t\t\t)\n\n\t\t\t\t\t// D3 moves the LEFT y-axis labels by 9\n\t\t\t\t\tconst availableSpace = xDimensions[0] - textWidth - 9\n\n\t\t\t\t\t// If space is available, align the label with the axis labels\n\t\t\t\t\tif (availableSpace > 1) {\n\t\t\t\t\t\tsvg.select('g.legend-title').attr('transform', `translate(${availableSpace}, 0)`)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Move the legend down by 16 pixels to display legend text on top\n\t\t\t\t\t\tsvg.select('g.legend').attr('transform', `translate(${xDimensions[0]}, 16)`)\n\n\t\t\t\t\t\t// Align legend title with start of axis\n\t\t\t\t\t\tsvg.select('g.legend-title').attr('transform', `translate(${xDimensions[0]}, 0)`)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Default state\n\t\t\tsvg.select('g.legend-title').attr('transform', `translate(0, 0)`)\n\t\t}\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = false) {\n\t\tconst options = this.getOptions()\n\t\tconst svg = this.getComponentContainer()\n\t\tconst { width } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tconst customColors = getProperty(options, 'color', 'gradient', 'colors')\n\n\t\tconst colorScaleType = getProperty(options, this.chartType, 'colorLegend', 'type')\n\n\t\tlet colorPairingOption = getProperty(options, 'color', 'pairing', 'option')\n\n\t\tconst title = getProperty(options, 'heatmap', 'colorLegend', 'title')\n\n\t\t// Clear DOM if loading\n\t\tconst isDataLoading = getProperty(this.getOptions(), 'data', 'loading')\n\n\t\tif (isDataLoading) {\n\t\t\tsvg.html('')\n\t\t\treturn\n\t\t}\n\n\t\tconst customColorsEnabled = !isEmpty(customColors)\n\t\tconst domain = getDomain(this.model.getDisplayData())\n\n\t\tconst useDefaultBarWidth = !(width <= legendConfigs.color.barWidth)\n\t\tconst barWidth = useDefaultBarWidth ? legendConfigs.color.barWidth : width\n\n\t\tconst legendGroupElement = DOMUtils.appendOrSelect(svg, 'g.legend')\n\t\tconst axisElement = DOMUtils.appendOrSelect(legendGroupElement, 'g.legend-axis')\n\n\t\t// Render title if it exists\n\t\tif (title) {\n\t\t\tconst legendTitleGroup = DOMUtils.appendOrSelect(svg, 'g.legend-title')\n\t\t\tconst legendTitle = DOMUtils.appendOrSelect(legendTitleGroup, 'text')\n\t\t\tlegendTitle.text(title).attr('dy', '0.7em')\n\n\t\t\t// Move the legend down by 16 pixels to display legend text on top\n\t\t\tlegendGroupElement.attr('transform', `translate(0, 16)`)\n\t\t}\n\n\t\t// If domain consists of negative and positive values, use diverging palettes\n\t\tconst colorScheme = domain[0] < 0 && domain[1] > 0 ? 'diverge' : 'mono'\n\n\t\t// Use default color pairing options if not in defined range\n\t\tif (colorPairingOption < 1 && colorPairingOption > 4 && colorScheme === 'mono') {\n\t\t\tcolorPairingOption = 1\n\t\t} else if (colorPairingOption < 1 && colorPairingOption > 2 && colorScheme === 'diverge') {\n\t\t\tcolorPairingOption = 1\n\t\t}\n\n\t\tlet colorPairing = []\n\t\t// Carbon charts has 11 colors for a single monochromatic palette & 17 for a divergent palette\n\t\tconst colorGroupingLength = colorScheme === 'diverge' ? 17 : 11\n\n\t\tif (!customColorsEnabled) {\n\t\t\t// Add class names to list and the amount based on the color scheme\n\t\t\tfor (let i = 1; i < colorGroupingLength + 1; i++) {\n\t\t\t\tcolorPairing.push(\n\t\t\t\t\tcolorScaleType === ColorLegendType.LINEAR\n\t\t\t\t\t\t? `stop-color-${colorScheme}-${colorPairingOption}-${i}`\n\t\t\t\t\t\t: `fill-${colorScheme}-${colorPairingOption}-${i}`\n\t\t\t\t)\n\t\t\t}\n\t\t} else {\n\t\t\t// Use custom colors\n\t\t\tcolorPairing = customColors\n\t\t}\n\n\t\t// Generate equal chunks between range to act as ticks\n\t\tconst interpolator = interpolateNumber(domain[0], domain[1])\n\t\tconst quant = quantize(interpolator, 3)\n\n\t\t// Create scale & ticks\n\t\tconst linearScale = scaleLinear().domain(domain).range([0, barWidth])\n\n\t\tconst legendAxis = axisBottom(linearScale).tickSize(0).tickValues(quant)\n\n\t\tlet rangeStart: any // avoid unexpected lexical declaration in case block\n\t\tswitch (colorScaleType) {\n\t\t\tcase ColorLegendType.LINEAR:\n\t\t\t\tthis.drawLinear(colorPairing, legendGroupElement, barWidth)\n\t\t\t\tbreak\n\t\t\tcase ColorLegendType.QUANTIZE:\n\t\t\t\trangeStart = this.drawQuantize(\n\t\t\t\t\tcolorPairing,\n\t\t\t\t\tcolorScheme,\n\t\t\t\t\tcustomColorsEnabled,\n\t\t\t\t\tlegendGroupElement,\n\t\t\t\t\tbarWidth\n\t\t\t\t)\n\t\t\t\t// Using range provided by drawQuantize for alignment purposes\n\t\t\t\tlinearScale.range([rangeStart, barWidth])\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tthrow Error('Entered color legend type is not supported.')\n\t\t}\n\n\t\t// Align axes at the bottom of the rectangle and delete the domain line\n\t\taxisElement\n\t\t\t.attr('transform', `translate(0,${legendConfigs.color.axisYTranslation})`)\n\t\t\t.call(legendAxis)\n\n\t\t// Remove auto generated axis bottom line\n\t\taxisElement.select('.domain').remove()\n\n\t\t// Translate first/last axis tick if barWidth equals chart width\n\t\t// Ensures text is not clipped when default bar width (300px) is not used\n\t\taxisElement\n\t\t\t.select('g.tick:last-of-type text')\n\t\t\t.style('text-anchor', useDefaultBarWidth ? 'middle' : 'end')\n\t\taxisElement\n\t\t\t.select('g.tick:first-of-type text')\n\t\t\t.style(\n\t\t\t\t'text-anchor',\n\t\t\t\tuseDefaultBarWidth && this.chartType !== 'choropleth' ? 'middle' : 'start'\n\t\t\t)\n\t}\n\n\t// Renders gradient legend\n\tdrawLinear(colorPairing: any, legendGroupElement: any, barWidth: any) {\n\t\tconst stopLengthPercentage = 100 / (colorPairing.length - 1)\n\n\t\t// Generate the gradient\n\t\tconst linearGradient = DOMUtils.appendOrSelect(legendGroupElement, 'linearGradient')\n\t\t// Rendering gradient\n\t\tlinearGradient\n\t\t\t.attr('id', `${this.gradient_id}-legend`)\n\t\t\t.selectAll('stop')\n\t\t\t.data(colorPairing)\n\t\t\t.enter()\n\t\t\t.append('stop')\n\t\t\t.attr('offset', (_: any, i: number) => `${i * stopLengthPercentage}%`)\n\t\t\t.attr('class', (_: any, i: number) => colorPairing[i])\n\t\t\t.attr('stop-color', (d: string) => d)\n\n\t\t// Create the legend container\n\t\tconst rectangle = DOMUtils.appendOrSelect(legendGroupElement, 'rect')\n\t\trectangle\n\t\t\t.attr('width', barWidth)\n\t\t\t.attr('height', legendConfigs.color.barHeight)\n\t\t\t.style('fill', `url(#${this.gradient_id}-legend)`)\n\t}\n\n\t/**\n\t * Renders quantized legend\n\t * @returns number (range start)\n\t */\n\tdrawQuantize(\n\t\tcolorPairing: any,\n\t\tcolorScheme: any,\n\t\tcustomColorsEnabled: any,\n\t\tlegendGroupElement: any,\n\t\tbarWidth: any\n\t) {\n\t\t// If divergent && non-custom color, remove 0/white from being displayed\n\t\tif (!customColorsEnabled && colorScheme === 'diverge') {\n\t\t\tcolorPairing.splice(colorPairing.length / 2, 1)\n\t\t}\n\n\t\tconst colorScaleBand = scaleBand().domain(colorPairing).range([0, barWidth])\n\n\t\t// Render the quantized rectangles\n\t\tconst rectangle = DOMUtils.appendOrSelect(legendGroupElement, 'g.quantized-rect')\n\n\t\trectangle\n\t\t\t.selectAll('rect')\n\t\t\t.data(colorScaleBand.domain())\n\t\t\t.join('rect')\n\t\t\t.attr('x', (d: string) => colorScaleBand(d))\n\t\t\t.attr('y', 0)\n\t\t\t.attr('width', Math.max(0, colorScaleBand.bandwidth() - 1))\n\t\t\t.attr('height', legendConfigs.color.barHeight)\n\t\t\t.attr('class', (d: string) => d)\n\t\t\t.attr('fill', (d: string) => d)\n\n\t\treturn (!customColorsEnabled && colorScheme) === 'mono' ? colorScaleBand.bandwidth() - 1 : 0\n\t}\n\n\tdestroy() {\n\t\tif (this.chartType === 'heatmap') {\n\t\t\t// Remove legend listeners\n\t\t\tconst eventsFragment = this.services.events\n\t\t\teventsFragment.removeEventListener(Events.Axis.RENDER_COMPLETE, this.handleAxisCompleteEvent)\n\t\t}\n\t}\n}\n","import type { Selection as D3Selection } from 'd3'\nimport { getProperty } from '@/tools'\nimport { meter as meterConfigs } from '@/configuration'\nimport { Title } from './title'\nimport { Dimensions, DOMUtils } from '@/services/essentials/dom-utils'\nimport { RenderTypes, Statuses } from '@/interfaces/enums'\nimport { MeterChartModel } from '@/model/meter'\n\nexport class MeterTitle extends Title {\n\ttype = 'meter-title'\n\trenderType = RenderTypes.SVG\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = false) {\n\t\tconst dataset = getProperty(this.model.getDisplayData(), 0)\n\t\tconst options = this.getOptions()\n\t\tconst svg = this.getComponentContainer()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst proportional = getProperty(options, 'meter', 'proportional')\n\n\t\tif (proportional) {\n\t\t\tthis.displayTotal()\n\t\t\tthis.displayBreakdownTitle()\n\t\t} else {\n\t\t\t// the title for a meter, is the label for that dataset\n\t\t\tconst title = svg.selectAll('text.meter-title').data([dataset[groupMapsTo]])\n\n\t\t\ttitle\n\t\t\t\t.enter()\n\t\t\t\t.append('text')\n\t\t\t\t.classed('meter-title', true)\n\t\t\t\t.merge(title as any)\n\t\t\t\t.attr('x', 0)\n\t\t\t\t.attr('y', '1em')\n\t\t\t\t.text((d: any) => d)\n\n\t\t\ttitle.exit().remove()\n\n\t\t\t// appends the associated percentage after title\n\t\t\tthis.appendPercentage()\n\t\t}\n\n\t\t// if status ranges are provided (custom or default), display indicator\n\t\tthis.displayStatus()\n\n\t\t// get the max width of a title (with consideration for the status/percentage)\n\t\tconst maxWidth = this.getMaxTitleWidth()\n\t\tconst titleElement = DOMUtils.appendOrSelect(svg, 'text.meter-title')\n\n\t\tif (maxWidth > 0 && titleElement.node().getComputedTextLength() > maxWidth) {\n\t\t\tthis.truncateTitle(titleElement, maxWidth)\n\t\t}\n\t}\n\n\tdisplayBreakdownTitle() {\n\t\tconst svg = this.getComponentContainer()\n\t\tconst options = this.getOptions()\n\t\tconst datasetsTotal = (this.model as MeterChartModel).getMaximumDomain(\n\t\t\tthis.model.getDisplayData()\n\t\t)\n\t\tconst total = getProperty(options, 'meter', 'proportional', 'total')\n\t\tconst unit = getProperty(options, 'meter', 'proportional', 'unit')\n\t\t\t? getProperty(options, 'meter', 'proportional', 'unit')\n\t\t\t: ''\n\n\t\tlet data\n\t\tif (datasetsTotal === total) {\n\t\t\tdata = null\n\t\t} else {\n\t\t\tconst difference = total !== null ? total - datasetsTotal : datasetsTotal\n\t\t\t//breakdownFormatter\n\t\t\tconst breakdownFormatter = getProperty(options, 'meter', 'proportional', 'breakdownFormatter')\n\t\t\tdata =\n\t\t\t\tbreakdownFormatter !== null\n\t\t\t\t\t? breakdownFormatter({\n\t\t\t\t\t\t\tdatasetsTotal: datasetsTotal,\n\t\t\t\t\t\t\ttotal: total\n\t\t\t\t\t\t})\n\t\t\t\t\t: `${datasetsTotal} ${unit} used (${difference} ${unit} available)`\n\t\t}\n\n\t\t// the breakdown part to whole of the datasets to the overall total\n\t\tconst title = svg.selectAll('text.proportional-meter-title').data([data])\n\n\t\ttitle\n\t\t\t.enter()\n\t\t\t.append('text')\n\t\t\t.classed('proportional-meter-title', true)\n\t\t\t.merge(title as any)\n\t\t\t.attr('x', 0)\n\t\t\t.attr('y', '1em')\n\t\t\t.text((d: any) => d)\n\n\t\ttitle.exit().remove()\n\n\t\tconst maxWidth = this.getMaxTitleWidth()\n\t\tconst titleElement = DOMUtils.appendOrSelect(svg, 'text.proportional-meter-title')\n\n\t\tif (maxWidth > 0 && titleElement.node().getComputedTextLength() > maxWidth) {\n\t\t\tthis.truncateTitle(titleElement, maxWidth)\n\t\t}\n\t}\n\n\t// show the total for prop meter\n\tdisplayTotal() {\n\t\tconst svg = this.getComponentContainer()\n\t\tconst options = this.getOptions()\n\n\t\tconst total = getProperty(options, 'meter', 'proportional', 'total')\n\n\t\tconst totalValue = total\n\t\t\t? getProperty(options, 'meter', 'proportional', 'total')\n\t\t\t: (this.model as MeterChartModel).getMaximumDomain(this.model.getDisplayData())\n\n\t\tconst unit = getProperty(options, 'meter', 'proportional', 'unit')\n\t\t\t? getProperty(options, 'meter', 'proportional', 'unit')\n\t\t\t: ''\n\n\t\t// totalFormatter function\n\t\tconst totalFormatter = getProperty(options, 'meter', 'proportional', 'totalFormatter')\n\n\t\tconst totalString =\n\t\t\ttotalFormatter !== null ? totalFormatter(totalValue) : `${total} ${unit} total`\n\n\t\tconst containerBounds = DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer())\n\n\t\t// need to check if the width is 0, and try to use the parent attribute\n\t\t// this can happen if the chart is toggled on/off and the height is 0 for the parent, it wont validateDimensions\n\t\tconst containerWidth = containerBounds.width\n\t\t\t? containerBounds.width\n\t\t\t: this.parent.node().getAttribute('width')\n\n\t\tconst title = svg.selectAll('text.proportional-meter-total').data([totalString])\n\n\t\ttitle\n\t\t\t.enter()\n\t\t\t.append('text')\n\t\t\t.classed('proportional-meter-total', true)\n\t\t\t.merge(title as any)\n\t\t\t// Position the total text -24 pixels to add spacing between text and status icon (if status exists)\n\t\t\t.attr(\n\t\t\t\t'x',\n\t\t\t\tthis.model.getStatus() && typeof containerWidth !== 'string'\n\t\t\t\t\t? containerWidth - meterConfigs.total.paddingRight\n\t\t\t\t\t: containerWidth\n\t\t\t)\n\t\t\t.attr('y', '1em')\n\t\t\t.attr('text-anchor', 'end')\n\t\t\t.text((d: any) => d)\n\n\t\ttitle.exit().remove()\n\t}\n\n\t/**\n\t * Appends the corresponding status based on the value and the peak.\n\t */\n\tdisplayStatus() {\n\t\tconst self = this\n\t\tconst svg = this.getComponentContainer()\n\n\t\tconst containerBounds = DOMUtils.getHTMLElementSize(\n\t\t\tthis.services.domUtils.getMainContainer()\n\t\t) as Dimensions\n\n\t\t// need to check if the width is 0, and try to use the parent attribute\n\t\t// this can happen if the chart is toggled on/off and the height is 0 for the parent, it wont validateDimensions\n\t\tconst containerWidth = containerBounds.width ? containerBounds.width : 0\n\n\t\t// get the status from the model\n\t\tconst status = this.model.getStatus()\n\t\tconst radius = meterConfigs.status.indicatorSize / 2\n\n\t\t// create a group for the icon/inner path\n\t\tconst statusGroup = DOMUtils.appendOrSelect(svg, `g.status-indicator`)\n\t\t\t.attr('class', status !== null ? `status-indicator status--${status}` : '')\n\t\t\t.attr('transform', `translate(${containerWidth - radius}, 0)`)\n\n\t\tconst data = status ? [status] : []\n\t\tconst icon = statusGroup.selectAll('circle.status').data(data) as D3Selection<\n\t\t\tSVGCircleElement,\n\t\t\tany,\n\t\t\tElement,\n\t\t\tany\n\t\t>\n\n\t\ticon\n\t\t\t.enter()\n\t\t\t.append('circle')\n\t\t\t.merge(icon)\n\t\t\t.attr('class', 'status')\n\t\t\t.attr('r', radius)\n\t\t\t.attr('cx', 0)\n\t\t\t.attr('cy', 8) // replaced `calc(1em / 2)` which is not an acceptable value for an SVG element's cy value\n\n\t\tconst innerIcon = statusGroup.selectAll('path.innerFill').data(data)\n\n\t\tinnerIcon\n\t\t\t.enter()\n\t\t\t.append('path')\n\t\t\t.merge(innerIcon as any)\n\t\t\t.attr('d', self.getStatusIconPathString(status))\n\t\t\t.attr('transform', `translate(-${radius}, 0)`)\n\t\t\t.attr('class', 'innerFill')\n\n\t\tinnerIcon.exit().remove()\n\t\ticon.exit().remove()\n\t}\n\n\t/**\n\t * Appends the associated percentage to the end of the title\n\t */\n\tappendPercentage() {\n\t\tconst dataValue = getProperty(this.model.getDisplayData(), 0, 'value')\n\n\t\t// use the title's position to append the percentage to the end\n\t\tconst svg = this.getComponentContainer()\n\t\tconst title = DOMUtils.appendOrSelect(svg, 'text.meter-title')\n\n\t\t// check if it is enabled\n\t\tconst data =\n\t\t\tgetProperty(this.getOptions(), 'meter', 'statusBar', 'percentageIndicator', 'enabled') ===\n\t\t\ttrue\n\t\t\t\t? [dataValue]\n\t\t\t\t: []\n\n\t\t// append a percentage if it is enabled, update it\n\t\tconst percentage = svg.selectAll('text.percent-value').data(data)\n\n\t\t// the horizontal offset of the percentage value from the title\n\t\tconst offset = meterConfigs.statusBar.paddingRight\n\n\t\tpercentage\n\t\t\t.enter()\n\t\t\t.append('text')\n\t\t\t.classed('percent-value', true)\n\t\t\t.merge(percentage as any)\n\t\t\t.text((d: any) => `${d}%`)\n\t\t\t.attr('x', +title.attr('x') + title.node().getComputedTextLength() + offset) // set the position to after the title\n\t\t\t.attr('y', title.attr('y'))\n\n\t\tpercentage.exit().remove()\n\t}\n\n\t/**\n\t * Uses the parent class truncate logic\n\t * @param title d3 selection of title element that will be truncated\n\t * @param titlestring the original string that needs truncation\n\t * @param maxWidth the max width the title can take\n\t */\n\ttruncateTitle(title: any, maxWidth: number) {\n\t\tsuper.truncateTitle(title, maxWidth)\n\n\t\t// update the position on the percentage to be inline with the title\n\t\tconst tspan = DOMUtils.appendOrSelect(this.parent, 'tspan')\n\t\tconst offset = meterConfigs.statusBar.paddingRight\n\t\tconst tspanLength = Math.ceil(tspan.node().getComputedTextLength())\n\n\t\tconst percentage = DOMUtils.appendOrSelect(this.parent, 'text.percent-value')\n\t\tpercentage.attr(\n\t\t\t'x',\n\t\t\t+title.attr('x') + title.node().getComputedTextLength() + tspanLength + offset\n\t\t)\n\t}\n\n\t// computes the maximum space a title can take\n\tprotected getMaxTitleWidth() {\n\t\t// get a reference to the title elements to calculate the size the title can be\n\t\tconst containerBounds = DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer())\n\n\t\tconst proportional = getProperty(this.getOptions(), 'meter', 'proportional')\n\n\t\t// Use parent's width if container has no width\n\t\tconst containerWidth = containerBounds.width\n\t\t\t? containerBounds.width\n\t\t\t: this.parent.node().getBoundingClientRect().width // fix to ensure a number and not a percentage\n\n\t\tif (proportional !== null) {\n\t\t\tconst total = DOMUtils.appendOrSelect(this.parent, 'text.proportional-meter-total').node()\n\n\t\t\tconst totalWidth = DOMUtils.getSVGElementSize(total, {\n\t\t\t\tuseBBox: true\n\t\t\t}).width\n\n\t\t\treturn containerWidth - totalWidth - meterConfigs.total.paddingLeft\n\t\t} else {\n\t\t\tconst percentage = DOMUtils.appendOrSelect(this.parent, 'text.percent-value')\n\t\t\t// the title needs to fit the width of the container without crowding the status, and percentage value\n\t\t\tconst offset = meterConfigs.statusBar.paddingRight\n\t\t\tconst percentageWidth = percentage.node().getComputedTextLength()\n\n\t\t\tconst statusGroup = DOMUtils.appendOrSelect(this.parent, 'g.status-indicator').node()\n\t\t\tconst statusWidth =\n\t\t\t\tDOMUtils.getSVGElementSize(statusGroup, { useBBox: true }).width +\n\t\t\t\tmeterConfigs.status.paddingLeft\n\n\t\t\treturn containerWidth - percentageWidth - offset - statusWidth\n\t\t}\n\t}\n\n\t/**\n\t * Get the associated status icon for the data\n\t * @param status the active status for the meter chart\n\t */\n\tprotected getStatusIconPathString(status: Statuses) {\n\t\tswitch (status) {\n\t\t\tcase Statuses.SUCCESS:\n\t\t\t\treturn 'M6.875 11.3125 3.75 8.1875 4.74375 7.25 6.875 9.34375 11.50625 4.75 12.5 5.7375 Z'\n\t\t\tcase Statuses.DANGER:\n\t\t\t\treturn 'M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z'\n\t\t\tcase Statuses.WARNING:\n\t\t\t\treturn 'M7.9375,11.125 C7.41973305,11.125 7,11.544733 7,12.0625 C7,12.580267 7.41973305,13 7.9375,13 C8.45526695,13 8.875,12.580267 8.875,12.0625 C8.875,11.544733 8.45526695,11.125 7.9375,11.125 M7.3125, 3 8.5625, 3 8.5625, 9.875 7.3125, 9.875, 7.3125, 3 Z'\n\t\t}\n\t}\n}\n","// Internal Imports\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { getProperty } from '@/tools'\n\nexport class Bar extends Component {\n\t// Gets the correct width for bars based on options & configurations\n\tprotected getBarWidth() {\n\t\tconst options = this.getOptions()\n\t\tif (options.bars.width) {\n\t\t\treturn options.bars.width\n\t\t}\n\n\t\tconst numberOfDatapoints = this.model.getDisplayData().length\n\t\tconst mainXScale = this.services.cartesianScales.getMainXScale()\n\t\tconst chartWidth = DOMUtils.getSVGElementSize((this as any).parent, {\n\t\t\tuseAttrs: true\n\t\t}).width\n\n\t\tif (!(mainXScale as any).step) {\n\t\t\tconst spacingFactor = getProperty(options, 'bars', 'spacingFactor')\n\n\t\t\treturn Math.min(options.bars.maxWidth, (chartWidth * spacingFactor) / numberOfDatapoints)\n\t\t}\n\n\t\treturn Math.min(options.bars.maxWidth, (mainXScale as any).step() / 2)\n\t}\n\n\tprotected isOutsideZoomedDomain(x0: number, x1: number) {\n\t\tconst dataCount = this.model.getDisplayData().length\n\t\t// if only one data point, never out of zoom domain\n\t\t// or it becomes a blank chart\n\t\tif (dataCount <= 1) {\n\t\t\treturn false\n\t\t}\n\n\t\tconst zoomDomain = this.model.get('zoomDomain')\n\t\tif (zoomDomain !== undefined) {\n\t\t\tconst domainScale = this.services.cartesianScales.getDomainScale()\n\t\t\treturn x0 < domainScale(zoomDomain[0]) || x1 > domainScale(zoomDomain[1])\n\t\t}\n\t\treturn false\n\t}\n}\n","import { hierarchy as d3Hierarchy, pack as D3Pack, select } from 'd3'\nimport { get } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { canvasZoomSettings, circlePack as circlePackConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { ColorClassNameTypes, Events, RenderTypes } from '@/interfaces/enums'\nimport { CirclePackChartModel } from '@/model/circle-pack'\n\nexport class CirclePack extends Component {\n\ttype = 'circle-pack'\n\trenderType = RenderTypes.SVG\n\n\tfocal: any\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\t// svg and container widths\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true })\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(this.parent as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\t// Because of a Firefox bug with regards to sizing & d3 packs,\n\t\t// rather than checking if height or width aren't 0,\n\t\t// we have to make sure they're not smaller than 1\n\t\tif (width < 1 || height < 1) {\n\t\t\t// on first render the svg is width and height 0\n\t\t\t// the circle packing layout functionality will not run\n\t\t\treturn\n\t\t}\n\n\t\t// data and options (zoom/not zoom)\n\t\tlet displayData = this.model.getDisplayData()\n\t\t// check if there is just one parent for the data\n\t\tconst parentNode = (this.model as CirclePackChartModel).hasParentNode()\n\t\tconst hierarchyLevel = (this.model as CirclePackChartModel).getHierarchyLevel()\n\t\tconst options = this.getOptions()\n\t\tconst canvasZoomEnabled = getProperty(options, 'canvasZoom', 'enabled')\n\n\t\t// check if there is one root for the data\n\t\t// that root will be the only datagroup (colorscale will be monochrome)\n\t\tif (parentNode && getProperty(displayData, 0, 'children')) {\n\t\t\t// remove want to remove the parent from being rendered\n\t\t\tdisplayData = getProperty(displayData, 0, 'children')\n\t\t}\n\n\t\tconst root = d3Hierarchy({ children: displayData })\n\t\t\t.sum((d: any) => d.value)\n\t\t\t.sort((a, b) => b.value - a.value)\n\n\t\tconst packLayout = D3Pack()\n\t\t\t.size([width, height])\n\t\t\t.padding((d: any) => {\n\t\t\t\t// add 3 px to account for the stroke width 1.5px\n\t\t\t\treturn d.depth >= 1\n\t\t\t\t\t? circlePackConfigs.padding.children + 3\n\t\t\t\t\t: circlePackConfigs.padding.mainGroup + 3\n\t\t\t})\n\n\t\tconst nodeData = packLayout(root)\n\t\t\t.descendants()\n\t\t\t.splice(1)\n\t\t\t.filter(node => {\n\t\t\t\t// filter based on hierarchy level\n\t\t\t\treturn node.depth <= hierarchyLevel\n\t\t\t})\n\n\t\t// enter the circles\n\t\tconst circles = svg.selectAll('circle.node').data(nodeData)\n\n\t\tcircles.exit().attr('width', 0).attr('height', 0).remove()\n\n\t\tconst enteringCircles = circles.enter().append('circle').classed('node', true)\n\n\t\tenteringCircles\n\t\t\t.merge(circles as any)\n\t\t\t.attr('class', (d: any) => {\n\t\t\t\tconst originalClass = canvasZoomEnabled && hierarchyLevel === 3 ? this.getZoomClass(d) : ''\n\t\t\t\treturn this.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL, ColorClassNameTypes.STROKE],\n\t\t\t\t\tdataGroupName: d.data.dataGroupName,\n\t\t\t\t\toriginalClassName: d.children\n\t\t\t\t\t\t? `node ${originalClass}`\n\t\t\t\t\t\t: `node node-leaf ${originalClass}`\n\t\t\t\t})\n\t\t\t})\n\t\t\t.style('fill', (d: any) => this.model.getFillColor(d.data.dataGroupName))\n\t\t\t.style('stroke', (d: any) => this.model.getFillColor(d.data.dataGroupName))\n\t\t\t.attr('cx', (d: any) => d.x)\n\t\t\t.attr('cy', (d: any) => d.y)\n\t\t\t.transition('circlepack-leaf-update-enter')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'circlepack-leaf-update-enter'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('r', (d: any) => d.r)\n\t\t\t.attr('opacity', 1)\n\t\t\t.attr('fill-opacity', circlePackConfigs.circles.fillOpacity)\n\n\t\tif (canvasZoomEnabled === true && this.focal) {\n\t\t\tthis.services.canvasZoom.zoomIn(this.focal, enteringCircles, canvasZoomSettings)\n\t\t\tthis.setBackgroundListeners()\n\t\t}\n\n\t\tif (!parentNode) {\n\t\t\t// add legend filtering if it isnt a monochrome chart\n\t\t\tthis.addLegendListeners()\n\t\t}\n\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners()\n\t}\n\n\t// turn off the highlight class on children circles\n\tunhighlightChildren(childData: any) {\n\t\tconst data = childData.map((d: any) => d.data)\n\n\t\tthis.parent\n\t\t\t.selectAll('circle.node')\n\t\t\t.filter((d: any) => data.some((datum: any) => datum === d.data) && d.depth > 1)\n\t\t\t.style('stroke', (d: any) => this.model.getFillColor(d.data.dataGroupName))\n\t}\n\n\t// highlight the children circles with a stroke\n\thighlightChildren(childData: any) {\n\t\tconst data = childData.map((d: any) => d.data)\n\n\t\tthis.parent\n\t\t\t.selectAll('circle.node')\n\t\t\t.filter((d: any) => data.some((datum: any) => datum === d.data) && d.depth > 1)\n\t\t\t.style('stroke', circlePackConfigs.circles.hover.stroke)\n\t}\n\n\tgetZoomClass(node: any) {\n\t\tif ((this.model as CirclePackChartModel).getHierarchyLevel() === 3 && this.focal) {\n\t\t\tif (\n\t\t\t\tnode.data === this.focal.data ||\n\t\t\t\tthis.focal.children.some((d: any) => d.data === node.data)\n\t\t\t) {\n\t\t\t\treturn 'focal'\n\t\t\t}\n\t\t}\n\t\treturn 'non-focal'\n\t}\n\n\taddLegendListeners() {\n\t\tconst { events } = this.services\n\t\t// Highlight correct circle on legend item hovers\n\t\tevents.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\t// Un-highlight circles on legend item mouseouts\n\t\tevents.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\tremoveBackgroundListeners() {\n\t\tconst chartSvg = select(this.services.domUtils.getMainContainer())\n\t\tchartSvg.on('click', () => null)\n\t}\n\n\tsetBackgroundListeners() {\n\t\tconst chartSvg = select(this.services.domUtils.getMainContainer())\n\t\tconst self = this\n\t\tconst canvasSelection = this.parent.selectAll('circle.node')\n\n\t\tchartSvg.on('click', () => {\n\t\t\tself.focal = null as any\n\t\t\t;(self.model as CirclePackChartModel).updateHierarchyLevel(2)\n\t\t\tchartSvg.classed('zoomed-in', false)\n\t\t\tself.services.canvasZoom.zoomOut(canvasSelection, canvasZoomSettings)\n\t\t})\n\t}\n\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\n\t\tthis.parent\n\t\t\t.selectAll('circle.node')\n\t\t\t.transition('legend-hover-circlepack')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-circlepack'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => {\n\t\t\t\treturn d.data.dataGroupName === hoveredElement.datum()['name']\n\t\t\t\t\t? 1\n\t\t\t\t\t: circlePackConfigs.circles.fillOpacity\n\t\t\t})\n\t}\n\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('circle.node')\n\t\t\t.transition('legend-mouseout-circlepack')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-circlepack'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\t// Zoom icon to be appended to the label in the tooltip\n\tgetZoomIcon() {\n\t\treturn `\n\t\t<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10 10\">\n\t\t\t<polygon points=\"5.93 3.71 4.45 3.71 4.45 2.23 3.71 2.23 3.71 3.71 2.23 3.71 2.23 4.45 3.71 4.45 3.71 5.93 4.45 5.93 4.45 4.45 5.93 4.45 5.93 3.71\"/>\n\t\t\t<path d=\"M7.2,6.67a4,4,0,0,0,1-2.59A4.08,4.08,0,1,0,4.07,8.15h0a4,4,0,0,0,2.59-1L9.48,10,10,9.48Zm-3.12.77A3.34,3.34,0,1,1,7.41,4.08,3.34,3.34,0,0,1,4.08,7.44Z\"/>\n\t\t</svg>`\n\t}\n\n\t// add event listeners for tooltip on the circles\n\taddEventListeners() {\n\t\tconst self = this\n\t\tthis.parent\n\t\t\t.selectAll('circle.node')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', true)\n\n\t\t\t\tconst hierarchyLevel = (self.model as CirclePackChartModel).getHierarchyLevel()\n\t\t\t\tconst disabled = hierarchyLevel > 2 && !hoveredElement.classed('focal')\n\t\t\t\tconst canvasZoomEnabled = getProperty(self.model.getOptions(), 'canvasZoom', 'enabled')\n\n\t\t\t\tlet zoomable = false\n\t\t\t\tif (!disabled) {\n\t\t\t\t\t// get the children data for the tooltip\n\t\t\t\t\tlet childrenData = []\n\t\t\t\t\tlet totalValue: any[] = []\n\t\t\t\t\tlet parentValue = null\n\t\t\t\t\tif (datum.children) {\n\t\t\t\t\t\tif (datum.depth > 1 && canvasZoomEnabled) {\n\t\t\t\t\t\t\tzoomable = true\n\t\t\t\t\t\t\thoveredElement.classed('clickable', true)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tchildrenData = datum.children.map((child: any) => {\n\t\t\t\t\t\t\tif (child !== null) {\n\t\t\t\t\t\t\t\t// retrieve the children values if there are any 3rd level\n\t\t\t\t\t\t\t\tif (typeof child.data.value === 'number') {\n\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\tlabel: child.data.name,\n\t\t\t\t\t\t\t\t\t\tvalue: child.data.value\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\tlabel: child.data.name,\n\t\t\t\t\t\t\t\t\t\tlabelIcon: canvasZoomEnabled && hierarchyLevel <= 2 ? self.getZoomIcon() : null,\n\t\t\t\t\t\t\t\t\t\tvalue: child.value\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t\t\t\tconst options = self.model.getOptions()\n\t\t\t\t\t\ttotalValue = [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: get(options, 'tooltip.totalLabel') || 'Total',\n\t\t\t\t\t\t\t\tvalue: datum.value,\n\t\t\t\t\t\t\t\tbold: true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t\t// children get a highlight stroke\n\t\t\t\t\t\tself.highlightChildren(datum.children)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// if there is no children we want to display the value for the data\n\t\t\t\t\t\tparentValue = datum.value\n\t\t\t\t\t}\n\n\t\t\t\t\tconst fillColor = getComputedStyle(this as Element, null).getPropertyValue('fill')\n\n\t\t\t\t\t// Show tooltip\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\thoveredElement,\n\t\t\t\t\t\titems: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcolor: fillColor,\n\t\t\t\t\t\t\t\tlabel: datum.data.name,\n\t\t\t\t\t\t\t\tlabelIcon:\n\t\t\t\t\t\t\t\t\tzoomable && canvasZoomEnabled && hierarchyLevel <= 2 ? self.getZoomIcon() : null,\n\t\t\t\t\t\t\t\tvalue: parentValue\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t...childrenData,\n\t\t\t\t\t\t\t...totalValue\n\t\t\t\t\t\t]\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.CirclePack.CIRCLE_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.CirclePack.CIRCLE_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', false)\n\n\t\t\t\tif (datum.children) {\n\t\t\t\t\tself.unhighlightChildren(datum.children)\n\t\t\t\t}\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.CirclePack.CIRCLE_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\tconst disabled = hoveredElement.classed('non-focal')\n\n\t\t\t\tconst canvasZoomEnabled = getProperty(self.model.getOptions(), 'canvasZoom', 'enabled')\n\n\t\t\t\tif (canvasZoomEnabled && (self.model as CirclePackChartModel).getHierarchyLevel() > 2) {\n\t\t\t\t\tconst canvasSelection = self.parent.selectAll('circle.node')\n\t\t\t\t\tconst chartSvg = select(self.services.domUtils.getMainContainer())\n\t\t\t\t\tchartSvg.classed('zoomed-in', false)\n\t\t\t\t\tself.focal = null as any\n\t\t\t\t\t;(self.model as CirclePackChartModel).updateHierarchyLevel(2)\n\t\t\t\t\tself.services.canvasZoom.zoomOut(canvasSelection, canvasZoomSettings)\n\t\t\t\t}\n\t\t\t\t// zoom if chart has zoom enabled and if its a depth 2 circle that has children\n\t\t\t\telse if (datum.depth === 2 && datum.children && !disabled && canvasZoomEnabled) {\n\t\t\t\t\tconst canvasSelection = self.parent.selectAll('circle.node')\n\t\t\t\t\tconst chartSvg = select(self.services.domUtils.getMainContainer())\n\t\t\t\t\tchartSvg.classed('zoomed-in', true)\n\t\t\t\t\tself.focal = datum as any\n\t\t\t\t\t;(self.model as CirclePackChartModel).updateHierarchyLevel(3)\n\t\t\t\t\tself.services.canvasZoom.zoomIn(datum, canvasSelection, canvasZoomSettings)\n\t\t\t\t\t// don't want the click event to propagate to the background zoom out\n\t\t\t\t\t// does not clash with the tooltip/other events because it does need to close the\n\t\t\t\t\t// tooltip on the click event in order to zoom in/out\n\t\t\t\t\tevent.stopPropagation()\n\t\t\t\t}\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.CirclePack.CIRCLE_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\tdestroy() {\n\t\t// Remove event listeners\n\t\tthis.parent\n\t\t\t.selectAll('circle.node')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('mouseout', null)\n\t\t\t.on('click', null)\n\n\t\t// remove the listeners on the legend\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\n\t\tthis.removeBackgroundListeners()\n\t}\n}\n","import { arc, interpolate, pie, select } from 'd3'\nimport { convertValueToPercentage, getProperty } from '@/tools'\nimport { pie as pieConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport {\n\tCalloutDirections,\n\tEvents,\n\tAlignments,\n\tColorClassNameTypes,\n\tRenderTypes\n} from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\n\n// Pie slice tween function\nfunction arcTween(a: any, arcFunc: any) {\n\tconst i = interpolate(this._current, a)\n\n\treturn (t: any) => {\n\t\tthis._current = i(t)\n\t\treturn arcFunc(this._current)\n\t}\n}\n\nexport class Pie extends Component {\n\ttype = 'pie'\n\trenderType = RenderTypes.SVG\n\n\t// We need to store our arcs\n\t// So that addEventListeners()\n\t// Can access them\n\tarc: any\n\thoverArc: any\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events\n\n\t\t// Highlight correct circle on legend item hovers\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\n\t\t// Un-highlight circles on legend item mouseouts\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\tgetInnerRadius() {\n\t\treturn pieConfigs.innerRadius\n\t}\n\n\trender(animate = true) {\n\t\tconst self = this\n\t\tconst svg = this.getComponentContainer()\n\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst { valueMapsTo } = options.pie\n\n\t\t// remove any slices that are valued at 0 because they dont need to be rendered and will create extra padding\n\t\tconst displayData = this.model.getDisplayData().filter((data: any) => data[valueMapsTo] > 0)\n\n\t\t// Compute the outer radius needed\n\t\tconst radius = this.computeRadius()\n\n\t\tthis.arc = arc().innerRadius(this.getInnerRadius()).outerRadius(radius)\n\n\t\t// Set the hover arc radius\n\t\tthis.hoverArc = arc()\n\t\t\t.innerRadius(this.getInnerRadius())\n\t\t\t.outerRadius(radius + pieConfigs.hoverArc.outerRadiusOffset)\n\n\t\t// Setup the pie layout\n\t\tconst pieLayout = pie()\n\t\t\t.value((d: any) => d[valueMapsTo])\n\t\t\t.sort(getProperty(options, 'pie', 'sortFunction'))\n\t\t\t.padAngle(pieConfigs.padAngle)\n\n\t\t// Add data to pie layout\n\t\tconst pieLayoutData = pieLayout(displayData)\n\n\t\t// Update data on all slices\n\t\tconst slicesGroup = DOMUtils.appendOrSelect(svg, 'g.slices')\n\t\t\t.attr('role', Roles.GROUP)\n\t\t\t.attr('data-name', 'slices')\n\n\t\tconst paths = slicesGroup\n\t\t\t.selectAll('path.slice')\n\t\t\t.data(pieLayoutData, (d: any) => d.data[groupMapsTo])\n\n\t\t// Remove slices that need to be exited\n\t\tpaths.exit().attr('opacity', 0).remove()\n\n\t\t// Add new slices that are being introduced\n\t\tconst enteringPaths = paths.enter().append('path').classed('slice', true).attr('opacity', 0)\n\n\t\t// Update styles & position on existing and entering slices\n\t\tconst allPaths = enteringPaths\n\t\t\t.merge(paths as any)\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: d.data[groupMapsTo],\n\t\t\t\t\toriginalClassName: 'slice'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('fill', (d: any) => self.model.getFillColor(d.data[groupMapsTo]))\n\t\t\t.attr('d', this.arc)\n\n\t\tallPaths\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'pie_slice_enter_update',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'slice')\n\t\t\t.attr(\n\t\t\t\t'aria-label',\n\t\t\t\t(d: any) =>\n\t\t\t\t\t`${d[valueMapsTo]}, ${\n\t\t\t\t\t\tconvertValueToPercentage(d.data[valueMapsTo], displayData, valueMapsTo) + '%'\n\t\t\t\t\t}`\n\t\t\t)\n\t\t\t// Tween\n\t\t\t.attrTween('d', function (a: any) {\n\t\t\t\treturn arcTween.bind(this)(a, self.arc)\n\t\t\t})\n\n\t\t// Draw the slice labels\n\t\tconst renderLabels = options.pie.labels.enabled\n\t\tconst labelData = renderLabels\n\t\t\t? pieLayoutData.filter(x => (x.data as any)[valueMapsTo] > 0)\n\t\t\t: []\n\t\tconst labelsGroup = DOMUtils.appendOrSelect(svg, 'g.labels')\n\t\t\t.attr('role', Roles.GROUP)\n\t\t\t.attr('data-name', 'labels')\n\n\t\tconst labels = labelsGroup\n\t\t\t.selectAll('text.pie-label')\n\t\t\t.data(labelData, (d: any) => d.data[groupMapsTo])\n\n\t\t// Remove labels that are existing\n\t\tlabels.exit().attr('opacity', 0).remove()\n\n\t\t// Add labels that are being introduced\n\t\tconst enteringLabels = labels.enter().append('text').classed('pie-label', true)\n\n\t\t// Update styles & position on existing & entering labels\n\t\tconst calloutData: any[] = []\n\t\tenteringLabels\n\t\t\t.merge(labels as any)\n\t\t\t.style('text-anchor', 'middle')\n\t\t\t.text((d: any) => {\n\t\t\t\tif (options.pie.labels.formatter) {\n\t\t\t\t\treturn options.pie.labels.formatter({\n\t\t\t\t\t\t...d,\n\t\t\t\t\t\tpercentageValue: convertValueToPercentage(\n\t\t\t\t\t\t\td.data[valueMapsTo],\n\t\t\t\t\t\t\tdisplayData,\n\t\t\t\t\t\t\tvalueMapsTo,\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t)\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\treturn convertValueToPercentage(d.data[valueMapsTo], displayData, valueMapsTo) + '%'\n\t\t\t})\n\t\t\t// Calculate dimensions in order to transform\n\t\t\t.datum(function (d: any) {\n\t\t\t\tconst marginedRadius = radius + 7\n\n\t\t\t\tconst theta = (d.endAngle - d.startAngle) / 2 + d.startAngle\n\t\t\t\tconst deg = (theta / Math.PI) * 180\n\n\t\t\t\tconst textLength = this.getComputedTextLength()\n\t\t\t\td.textOffsetX = textLength / 2\n\t\t\t\td.textOffsetY = deg > 90 && deg < 270 ? 10 : 0\n\n\t\t\t\td.xPosition = (d.textOffsetX + marginedRadius) * Math.sin(theta)\n\t\t\t\td.yPosition = (d.textOffsetY + marginedRadius) * -Math.cos(theta)\n\n\t\t\t\treturn d\n\t\t\t})\n\t\t\t.attr('transform', function (d: any, i: number) {\n\t\t\t\tconst totalSlices = labelData.length\n\t\t\t\tconst sliceAngleDeg = (d.endAngle - d.startAngle) * (180 / Math.PI)\n\n\t\t\t\t// check if last 2 slices (or just last) are < the threshold\n\t\t\t\tif (i >= totalSlices - 2) {\n\t\t\t\t\tif (sliceAngleDeg < pieConfigs.callout.minSliceDegree) {\n\t\t\t\t\t\tlet labelTranslateX, labelTranslateY\n\t\t\t\t\t\tif (d.index === totalSlices - 1) {\n\t\t\t\t\t\t\tlabelTranslateX =\n\t\t\t\t\t\t\t\td.xPosition +\n\t\t\t\t\t\t\t\tpieConfigs.callout.offsetX +\n\t\t\t\t\t\t\t\tpieConfigs.callout.textMargin +\n\t\t\t\t\t\t\t\td.textOffsetX\n\t\t\t\t\t\t\tlabelTranslateY = d.yPosition - pieConfigs.callout.offsetY\n\n\t\t\t\t\t\t\t// Set direction of callout\n\t\t\t\t\t\t\td.direction = CalloutDirections.RIGHT\n\t\t\t\t\t\t\tcalloutData.push(d)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlabelTranslateX =\n\t\t\t\t\t\t\t\td.xPosition -\n\t\t\t\t\t\t\t\tpieConfigs.callout.offsetX -\n\t\t\t\t\t\t\t\td.textOffsetX -\n\t\t\t\t\t\t\t\tpieConfigs.callout.textMargin\n\t\t\t\t\t\t\tlabelTranslateY = d.yPosition - pieConfigs.callout.offsetY\n\n\t\t\t\t\t\t\t// Set direction of callout\n\t\t\t\t\t\t\td.direction = CalloutDirections.LEFT\n\t\t\t\t\t\t\tcalloutData.push(d)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn `translate(${labelTranslateX}, ${labelTranslateY})`\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn `translate(${d.xPosition}, ${d.yPosition})`\n\t\t\t})\n\n\t\t// Render pie label callouts\n\t\tthis.renderCallouts(calloutData)\n\n\t\tconst optionName = getProperty(options, 'donut') ? 'donut' : 'pie'\n\t\tconst alignment = getProperty(options, optionName, 'alignment')\n\n\t\tconst { width } = DOMUtils.getSVGElementSize(this.getParent() as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\t// don't add padding for labels & callouts if they are disabled\n\t\tconst xOffset = renderLabels ? pieConfigs.xOffset : 0\n\t\tconst yOffset = renderLabels ? pieConfigs.yOffset : 0\n\n\t\t// Position Pie\n\t\tlet pieTranslateX = radius + xOffset\n\t\tif (alignment === Alignments.CENTER) {\n\t\t\tpieTranslateX = width / 2\n\t\t} else if (alignment === Alignments.RIGHT) {\n\t\t\tpieTranslateX = width - radius - pieConfigs.xOffset\n\t\t}\n\n\t\tlet pieTranslateY = radius + yOffset\n\t\tif (calloutData.length > 0) {\n\t\t\tpieTranslateY += pieConfigs.yOffsetCallout\n\t\t}\n\n\t\tsvg.attr('x', pieTranslateX + 7).attr('y', pieTranslateY)\n\n\t\t// Add event listeners\n\t\tthis.addEventListeners()\n\t}\n\n\trenderCallouts(calloutData: any[]) {\n\t\tconst svg = DOMUtils.appendOrSelect(this.getComponentContainer(), 'g.callouts')\n\t\t\t.attr('role', Roles.GROUP)\n\t\t\t.attr('data-name', 'callouts')\n\n\t\t// Update data on callouts\n\t\tconst callouts = svg.selectAll('g.callout').data(calloutData)\n\n\t\tcallouts.exit().remove()\n\n\t\tconst enteringCallouts = callouts\n\t\t\t.enter()\n\t\t\t.append('g')\n\t\t\t.classed('callout', true)\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GROUP)\n\t\t\t.attr('aria-roledescription', 'label callout')\n\n\t\t// Update data values for each callout\n\t\t// For the horizontal and vertical lines to use\n\t\tenteringCallouts.merge(callouts as any).datum(function (d: any) {\n\t\t\tconst { xPosition, yPosition, direction } = d\n\n\t\t\tif (direction === CalloutDirections.RIGHT) {\n\t\t\t\td.startPos = {\n\t\t\t\t\tx: xPosition,\n\t\t\t\t\ty: yPosition + d.textOffsetY\n\t\t\t\t}\n\n\t\t\t\t// end position for the callout line\n\t\t\t\td.endPos = {\n\t\t\t\t\tx: xPosition + pieConfigs.callout.offsetX,\n\t\t\t\t\ty: yPosition - pieConfigs.callout.offsetY + d.textOffsetY\n\t\t\t\t}\n\n\t\t\t\t// the intersection point of the vertical and horizontal line\n\t\t\t\td.intersectPointX = d.endPos.x - pieConfigs.callout.horizontalLineLength\n\t\t\t} else {\n\t\t\t\t// start position for the callout line\n\t\t\t\td.startPos = {\n\t\t\t\t\tx: xPosition,\n\t\t\t\t\ty: yPosition + d.textOffsetY\n\t\t\t\t}\n\n\t\t\t\t// end position for the callout line should be bottom aligned to the title\n\t\t\t\td.endPos = {\n\t\t\t\t\tx: xPosition - pieConfigs.callout.offsetX,\n\t\t\t\t\ty: yPosition - pieConfigs.callout.offsetY + d.textOffsetY\n\t\t\t\t}\n\n\t\t\t\t// the intersection point of the vertical and horizontal line\n\t\t\t\td.intersectPointX = d.endPos.x + pieConfigs.callout.horizontalLineLength\n\t\t\t}\n\n\t\t\t// Store the necessary data in the DOM element\n\t\t\treturn d\n\t\t})\n\n\t\t// draw vertical line\n\t\tconst enteringVerticalLines = enteringCallouts.append('line').classed('vertical-line', true)\n\n\t\tenteringVerticalLines\n\t\t\t.merge(svg.selectAll('line.vertical-line'))\n\t\t\t.datum(function () {\n\t\t\t\treturn select(this.parentNode as any).datum()\n\t\t\t})\n\t\t\t.style('stroke-width', '1px')\n\t\t\t.attr('x1', (d: any) => d.startPos.x)\n\t\t\t.attr('y1', (d: any) => d.startPos.y)\n\t\t\t.attr('x2', (d: any) => d.intersectPointX)\n\t\t\t.attr('y2', (d: any) => d.endPos.y)\n\n\t\t// draw horizontal line\n\t\tconst enteringHorizontalLines = enteringCallouts.append('line').classed('horizontal-line', true)\n\n\t\tenteringHorizontalLines\n\t\t\t.merge(svg.selectAll('line.horizontal-line'))\n\t\t\t.datum(function () {\n\t\t\t\treturn select(this.parentNode as any).datum()\n\t\t\t})\n\t\t\t.style('stroke-width', '1px')\n\t\t\t.attr('x1', (d: any) => d.intersectPointX)\n\t\t\t.attr('y1', (d: any) => d.endPos.y)\n\t\t\t.attr('x2', (d: any) => d.endPos.x)\n\t\t\t.attr('y2', (d: any) => d.endPos.y)\n\t}\n\n\t// Highlight elements that match the hovered legend item\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\t\tconst { groupMapsTo } = this.getOptions().data\n\n\t\tthis.parent\n\t\t\t.selectAll('path.slice')\n\t\t\t.transition('legend-hover-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) =>\n\t\t\t\td.data[groupMapsTo] !== hoveredElement.datum()['name'] ? 0.3 : 1\n\t\t\t)\n\t}\n\n\t// Un-highlight all elements\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('path.slice')\n\t\t\t.transition('legend-mouseout-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this\n\t\tthis.parent\n\t\t\t.selectAll('path.slice')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\thoveredElement\n\t\t\t\t\t.classed('hovered', true)\n\t\t\t\t\t.transition('pie_slice_mouseover')\n\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\tname: 'pie_slice_mouseover'\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.attr('d', self.hoverArc)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Pie.SLICE_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tconst { groupMapsTo } = self.getOptions().data\n\t\t\t\tconst { valueMapsTo } = self.getOptions().pie\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: datum.data[groupMapsTo],\n\t\t\t\t\t\t\tvalue: datum.data[valueMapsTo]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Pie.SLICE_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Pie.SLICE_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement\n\t\t\t\t\t.classed('hovered', false)\n\t\t\t\t\t.transition('pie_slice_mouseout')\n\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\tname: 'pie_slice_mouseout'\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.attr('d', self.arc)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Pie.SLICE_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\t// Helper functions\n\tprotected computeRadius() {\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(this.parent as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tconst options = this.getOptions()\n\t\tconst radius: number = Math.min(width, height) / 2\n\t\tconst renderLabels = options.pie.labels.enabled\n\n\t\treturn renderLabels ? radius + pieConfigs.radiusOffset : radius\n\t}\n}\n","import { interpolateNumber, interpolateRound, select } from 'd3'\nimport { getProperty } from '@/tools'\nimport { Pie } from './pie'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { RenderTypes } from '@/interfaces/enums'\n\nexport class Donut extends Pie {\n\ttype = 'donut'\n\trenderType = RenderTypes.SVG\n\n\trender(animate = true) {\n\t\t// Call render() from Pie\n\t\tsuper.render(animate)\n\n\t\tconst self = this\n\n\t\t// if there are no data, remove the center content\n\t\t// that is the old one and do nothing\n\t\tif (this.model.isDataEmpty()) {\n\t\t\tthis.getComponentContainer().select('g.center').remove()\n\t\t\treturn\n\t\t}\n\n\t\tconst svg = DOMUtils.appendOrSelect(this.getComponentContainer(), 'g.center')\n\t\tconst options = this.getOptions()\n\n\t\t// Compute the outer radius needed\n\t\tconst radius = this.computeRadius()\n\t\tconst donutTitle = getProperty(options, 'donut', 'center', 'label')\n\n\t\t// Add the number shown in the center of the donut\n\t\tDOMUtils.appendOrSelect(svg, 'text.donut-figure')\n\t\t\t.attr('text-anchor', 'middle')\n\t\t\t.style('dominant-baseline', () => {\n\t\t\t\t// Center figure if title is empty\n\t\t\t\tif (donutTitle === null || donutTitle === '') {\n\t\t\t\t\treturn 'central'\n\t\t\t\t}\n\n\t\t\t\treturn 'initial'\n\t\t\t})\n\t\t\t.style('font-size', () => options.donut.center.numberFontSize(radius))\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'donut-figure-enter-update',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.tween('text', function () {\n\t\t\t\treturn self.centerNumberTween(select(this))\n\t\t\t})\n\n\t\t// Title will be rendered only if it isn't empty\n\t\tif (donutTitle !== null && donutTitle !== '') {\n\t\t\t// Add the label below the number in the center of the donut\n\t\t\tDOMUtils.appendOrSelect(svg, 'text.donut-title')\n\t\t\t\t.attr('text-anchor', 'middle')\n\t\t\t\t.style('font-size', () => options.donut.center.titleFontSize(radius))\n\t\t\t\t.attr('y', options.donut.center.titleYPosition(radius))\n\t\t\t\t.text(donutTitle)\n\t\t}\n\t}\n\n\tgetInnerRadius() {\n\t\t// Compute the outer radius needed\n\t\tconst radius = this.computeRadius()\n\n\t\treturn radius * (3 / 4)\n\t}\n\n\tcenterNumberTween(d3Ref: any) {\n\t\tconst options = this.getOptions()\n\n\t\tlet donutCenterFigure = getProperty(options, 'donut', 'center', 'number')\n\t\tif (donutCenterFigure === null) {\n\t\t\tdonutCenterFigure = this.model.getDisplayData().reduce((accumulator: number, d: any) => {\n\t\t\t\treturn accumulator + d[options.pie.valueMapsTo]\n\t\t\t}, 0)\n\t\t}\n\n\t\t// Remove commas from the current value string, and convert to an int\n\t\tconst currentValue = parseInt(d3Ref.text().replace(/[, ]+/g, ''), 10) || 0\n\n\t\tlet interpolateFunction\n\t\tif (currentValue % 1 === 0 && donutCenterFigure % 1 === 0) {\n\t\t\tinterpolateFunction = interpolateRound\n\t\t} else {\n\t\t\tinterpolateFunction = interpolateNumber\n\t\t}\n\n\t\tconst i = interpolateFunction(currentValue, donutCenterFigure)\n\n\t\treturn (t: any) => {\n\t\t\tconst { numberFormatter } = options.donut.center\n\t\t\td3Ref.text(numberFormatter(i(t)))\n\t\t}\n\t}\n}\n","import { arc, select } from 'd3'\nimport { clamp } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport {\n\tEvents,\n\tGaugeTypes,\n\tArrowDirections,\n\tColorClassNameTypes,\n\tAlignments,\n\tRenderTypes\n} from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\n\n// arrow paths for delta\nconst ARROW_UP_PATH_STRING = '4,10 8,6 12,10'\nconst ARROW_DOWN_PATH_STRING = '12,6 8,10 4,6'\n\nexport class Gauge extends Component {\n\ttype = 'gauge'\n\trenderType = RenderTypes.SVG\n\n\t// We need to store our arcs so that addEventListeners() can access them\n\tarc: any\n\tbackgroundArc: any\n\n\tgetValue(): number {\n\t\tconst data = this.model.getData()\n\t\tconst value = data.find((d: any) => d.group === 'value')?.value ?? null\n\t\treturn value\n\t}\n\n\tgetValueRatio(): number {\n\t\tconst value = clamp(this.getValue(), 0, 100)\n\t\treturn value / 100\n\t}\n\n\tgetDelta(): number {\n\t\tconst data = this.model.getData()\n\t\tconst delta = data.find((d: any) => d.group === 'delta')?.value ?? null\n\t\treturn delta\n\t}\n\n\tgetArcRatio(): number {\n\t\tconst options = this.getOptions()\n\t\tconst type = getProperty(options, 'gauge', 'type')\n\t\tconst arcRatio = type === GaugeTypes.FULL ? 1 : 0.5\n\t\treturn arcRatio\n\t}\n\n\tgetArcSize(): number {\n\t\treturn this.getArcRatio() * Math.PI * 2\n\t}\n\n\tgetStartAngle(): number {\n\t\tconst arcSize = this.getArcSize()\n\t\tif (arcSize === 2 * Math.PI) {\n\t\t\treturn 0\n\t\t}\n\t\treturn -arcSize / 2\n\t}\n\n\t// use provided arrow direction or default to using the delta\n\tgetArrow(delta: any): string {\n\t\tconst options = this.getOptions()\n\t\tconst arrowDirection = getProperty(options, 'gauge', 'deltaArrow', 'direction')\n\n\t\tswitch (arrowDirection) {\n\t\t\tcase ArrowDirections.UP:\n\t\t\t\treturn ARROW_UP_PATH_STRING\n\t\t\tcase ArrowDirections.DOWN:\n\t\t\t\treturn ARROW_DOWN_PATH_STRING\n\t\t\tdefault:\n\t\t\t\treturn delta > 0 ? ARROW_UP_PATH_STRING : ARROW_DOWN_PATH_STRING\n\t\t}\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer().attr('width', '100%').attr('height', '100%')\n\t\tconst options = this.getOptions()\n\n\t\tconst value = this.getValue()\n\t\tconst valueRatio = this.getValueRatio()\n\t\tconst arcSize = this.getArcSize()\n\n\t\t// angles for drawing the gauge\n\t\tconst startAngle = this.getStartAngle()\n\t\tconst rotationAngle = valueRatio * arcSize\n\t\tconst currentAngle = startAngle + rotationAngle\n\t\tconst endAngle = startAngle + arcSize\n\n\t\t// Compute the outer radius needed\n\t\tconst radius = this.computeRadius()\n\t\tconst innerRadius = this.getInnerRadius()\n\n\t\t// draw the container and arc\n\t\tthis.backgroundArc = arc()\n\t\t\t.innerRadius(innerRadius)\n\t\t\t.outerRadius(radius)\n\t\t\t.startAngle(currentAngle)\n\t\t\t.endAngle(endAngle)\n\n\t\tthis.arc = arc()\n\t\t\t.innerRadius(innerRadius)\n\t\t\t.outerRadius(radius)\n\t\t\t.startAngle(startAngle)\n\t\t\t.endAngle(currentAngle)\n\n\t\t// draw the container\n\t\tDOMUtils.appendOrSelect(svg, 'path.arc-background').attr('d', this.backgroundArc)\n\n\t\t// Add data arc\n\t\tconst arcValue = svg.selectAll('path.arc-foreground').data([value])\n\t\tconst arcEnter = arcValue.enter().append('path')\n\n\t\tarcEnter\n\t\t\t.merge(arcValue as any)\n\t\t\t.attr(\n\t\t\t\t'class',\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: 'value',\n\t\t\t\t\toriginalClassName: 'arc-foreground'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('fill', () => getProperty(this.getOptions(), 'color', 'scale', 'value'))\n\t\t\t.attr('d', this.arc)\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'value')\n\t\t\t.attr('aria-label', (d: any) => d)\n\n\t\t// draw the value and delta to the center\n\t\tthis.drawValueNumber()\n\t\tthis.drawDelta()\n\n\t\tarcValue.exit().remove()\n\n\t\tconst alignment = getProperty(options, 'gauge', 'alignment')\n\n\t\tconst { width } = DOMUtils.getSVGElementSize(this.getParent() as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\t// Position gauge\n\t\tlet gaugeTranslateX = radius\n\t\tif (alignment === Alignments.CENTER) {\n\t\t\tgaugeTranslateX = width / 2\n\t\t} else if (alignment === Alignments.RIGHT) {\n\t\t\tgaugeTranslateX = width - radius\n\t\t}\n\t\tsvg.attr('x', gaugeTranslateX).attr('y', radius)\n\n\t\t// Add event listeners\n\t\tthis.addEventListeners()\n\t}\n\n\t/**\n\t * draws the value number associated with the Gauge component in the center\n\t */\n\tdrawValueNumber() {\n\t\tconst svg = this.getComponentContainer()\n\t\tconst options = this.getOptions()\n\n\t\tconst arcType = getProperty(options, 'gauge', 'type')\n\t\tconst value = this.getValue()\n\t\tconst delta = this.getDelta()\n\n\t\t// Sizing and positions relative to the radius\n\t\tconst radius = this.computeRadius()\n\n\t\tconst valueFontSize = getProperty(options, 'gauge', 'valueFontSize')\n\t\t// if there is a delta, use the size to center the numbers, otherwise center the valueNumber\n\t\tconst deltaFontSize = getProperty(options, 'gauge', 'deltaFontSize')\n\n\t\tconst numberSpacing = getProperty(options, 'gauge', 'numberSpacing')\n\n\t\tconst showPercentageSymbol = getProperty(options, 'gauge', 'showPercentageSymbol')\n\n\t\t// circular gauge without delta should have valueNumber centered\n\t\tlet numbersYPosition = 0\n\t\tif (arcType === GaugeTypes.FULL && !delta) {\n\t\t\tnumbersYPosition = deltaFontSize(radius)\n\t\t} else if (arcType === GaugeTypes.SEMI && delta) {\n\t\t\t// semi circular gauge we want the numbers aligned to the chart container\n\t\t\tnumbersYPosition = -(deltaFontSize(radius) + numberSpacing)\n\t\t}\n\n\t\t// Add the numbers at the center\n\t\tconst numbersGroup = DOMUtils.appendOrSelect(svg, 'g.gauge-numbers').attr(\n\t\t\t'transform',\n\t\t\t`translate(0, ${numbersYPosition})`\n\t\t)\n\n\t\tconst fontSize = valueFontSize(radius)\n\t\t// Add the big number\n\t\tconst valueNumberGroup = DOMUtils.appendOrSelect(numbersGroup, 'g.gauge-value-number')\n\n\t\tconst numberFormatter = getProperty(options, 'gauge', 'numberFormatter')\n\t\tconst valueNumber = valueNumberGroup.selectAll('text.gauge-value-number').data([value])\n\n\t\tvalueNumber\n\t\t\t.enter()\n\t\t\t.append('text')\n\t\t\t.attr('class', 'gauge-value-number')\n\t\t\t.merge(valueNumber as any)\n\t\t\t.style('font-size', `${fontSize}px`)\n\t\t\t.attr('text-anchor', 'middle')\n\t\t\t.text((d: any) => numberFormatter(d))\n\n\t\t// add the percentage symbol beside the valueNumber\n\t\tconst { width: valueNumberWidth } = DOMUtils.getSVGElementSize(\n\t\t\tDOMUtils.appendOrSelect(svg, 'text.gauge-value-number'),\n\t\t\t{ useBBox: true }\n\t\t)\n\n\t\tconst symbolFontSize = fontSize / 2\n\t\tconst gaugeSymbol = showPercentageSymbol ? '%' : ''\n\t\tconst symbol = DOMUtils.appendOrSelect(valueNumberGroup, 'text.gauge-value-symbol')\n\t\t\t.style('font-size', `${symbolFontSize}px`)\n\t\t\t.attr('x', valueNumberWidth / 2)\n\t\t\t.text(gaugeSymbol)\n\n\t\tconst { width: symbolWidth, height: symbolHeight } = DOMUtils.getSVGElementSize(symbol, {\n\t\t\tuseBBox: true\n\t\t})\n\n\t\t// adjust the symbol to superscript using the bbox instead of the font-size cause\n\t\t// we want to align the actual character to the value number\n\t\tsymbol.attr('y', `-${symbolHeight / 2}px`)\n\n\t\t// move the value group depending on the symbol's drawn size\n\t\tvalueNumberGroup.attr('transform', `translate(-${symbolWidth / 2}, 0)`) // Optical centering for the presence of the smaller % symbol\n\t}\n\n\t/**\n\t * adds the delta number for the gauge\n\t */\n\tdrawDelta() {\n\t\tconst self = this\n\t\tconst svg = this.getComponentContainer()\n\t\tconst options = this.getOptions()\n\t\tconst delta = this.getDelta()\n\n\t\tif (!delta) {\n\t\t\tconst deltaGroup = svg.select('g.gauge-delta')\n\n\t\t\tif (!deltaGroup.empty()) {\n\t\t\t\tdeltaGroup.remove()\n\t\t\t}\n\t\t} else {\n\t\t\t// Sizing and positions relative to the radius\n\t\t\tconst radius = this.computeRadius()\n\t\t\tconst deltaFontSize = delta ? getProperty(options, 'gauge', 'deltaFontSize') : () => 0\n\n\t\t\t// use numberFormatter here only if there is a delta supplied\n\t\t\tconst numberFormatter = delta\n\t\t\t\t? getProperty(options, 'gauge', 'numberFormatter')\n\t\t\t\t: (): any => null\n\n\t\t\tconst arrowSize = getProperty(options, 'gauge', 'deltaArrow', 'size')\n\t\t\tconst numberSpacing = getProperty(options, 'gauge', 'numberSpacing')\n\n\t\t\tconst showPercentageSymbol = getProperty(options, 'gauge', 'showPercentageSymbol')\n\n\t\t\tconst numbersGroup = DOMUtils.appendOrSelect(svg, 'g.gauge-numbers')\n\n\t\t\t// Add the smaller number of the delta\n\t\t\tconst deltaGroup = DOMUtils.appendOrSelect(numbersGroup, 'g.gauge-delta').attr(\n\t\t\t\t'transform',\n\t\t\t\t`translate(0, ${deltaFontSize(radius) + numberSpacing})`\n\t\t\t)\n\n\t\t\tconst deltaNumber = DOMUtils.appendOrSelect(deltaGroup, 'text.gauge-delta-number')\n\t\t\tconst gaugeSymbol = showPercentageSymbol ? '%' : ''\n\n\t\t\tdeltaNumber.data(delta === null ? [] : [delta])\n\n\t\t\tdeltaNumber\n\t\t\t\t.enter()\n\t\t\t\t.append('text')\n\t\t\t\t.classed('gauge-delta-number', true)\n\t\t\t\t.merge(deltaNumber)\n\t\t\t\t.attr('text-anchor', 'middle')\n\t\t\t\t.style('font-size', `${deltaFontSize(radius)}px`)\n\t\t\t\t.text((d: any) => `${numberFormatter(d)}${gaugeSymbol}`)\n\n\t\t\t// Add the caret for the delta number\n\t\t\tconst { width: deltaNumberWidth } = DOMUtils.getSVGElementSize(\n\t\t\t\tDOMUtils.appendOrSelect(svg, '.gauge-delta-number'),\n\t\t\t\t{ useBBox: true }\n\t\t\t)\n\n\t\t\t// check if delta arrow is disabled\n\t\t\tconst arrowEnabled = getProperty(options, 'gauge', 'deltaArrow', 'enabled')\n\n\t\t\tconst deltaArrow = deltaGroup\n\t\t\t\t.selectAll('svg.gauge-delta-arrow')\n\t\t\t\t.data(delta !== null && arrowEnabled ? [delta] : [])\n\n\t\t\tdeltaArrow\n\t\t\t\t.enter()\n\t\t\t\t.append('svg')\n\t\t\t\t.merge(deltaArrow as any)\n\t\t\t\t.attr('class', 'gauge-delta-arrow')\n\t\t\t\t.attr('x', -arrowSize(radius) - deltaNumberWidth / 2)\n\t\t\t\t.attr('y', -arrowSize(radius) / 2 - deltaFontSize(radius) * 0.35)\n\t\t\t\t.attr('width', arrowSize(radius))\n\t\t\t\t.attr('height', arrowSize(radius))\n\t\t\t\t.attr('viewBox', '0 0 16 16')\n\t\t\t\t/*\n\t\t\t\t * using .each() here to ensure that the below function runs\n\t\t\t\t * after svg.gauge-delta-arrow has been mounted onto the DOM\n\t\t\t\t */\n\t\t\t\t.each(function () {\n\t\t\t\t\tconst deltaArrowSelection = select(this)\n\n\t\t\t\t\t// Needed to correctly size SVG in Firefox\n\t\t\t\t\tDOMUtils.appendOrSelect(deltaArrowSelection, 'rect.gauge-delta-arrow-backdrop')\n\t\t\t\t\t\t.attr('width', '16')\n\t\t\t\t\t\t.attr('height', '16')\n\t\t\t\t\t\t.attr('fill', 'none')\n\n\t\t\t\t\t// Draw the arrow with status\n\t\t\t\t\tconst status = getProperty(options, 'gauge', 'status')\n\t\t\t\t\tDOMUtils.appendOrSelect(deltaArrowSelection, 'polygon.gauge-delta-arrow')\n\t\t\t\t\t\t.attr('class', status !== null ? `gauge-delta-arrow status--${status}` : '')\n\t\t\t\t\t\t.attr('points', self.getArrow(delta))\n\t\t\t\t})\n\n\t\t\tdeltaArrow.exit().remove()\n\t\t\tdeltaNumber.exit().remove()\n\t\t}\n\t}\n\n\tgetInnerRadius() {\n\t\t// Compute the outer radius needed\n\t\tconst radius = this.computeRadius()\n\t\tconst arcWidth = getProperty(this.getOptions(), 'gauge', 'arcWidth')\n\t\treturn radius - arcWidth\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this\n\t\tthis.parent\n\t\t\t.selectAll('path.arc-foreground')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Gauge.ARC_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Gauge.ARC_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Gauge.ARC_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Gauge.ARC_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\t// Helper functions\n\tprotected computeRadius() {\n\t\tconst options = this.getOptions()\n\t\tconst arcType = getProperty(options, 'gauge', 'type')\n\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(this.parent as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\t\tconst radius =\n\t\t\tarcType === GaugeTypes.SEMI ? Math.min(width / 2, height) : Math.min(width / 2, height / 2)\n\n\t\treturn radius\n\t}\n}\n","import { ScaleBand, scaleBand, select } from 'd3'\nimport { uniq } from 'lodash-es'\nimport { generateSVGPathString, getProperty } from '@/tools'\nimport { Bar } from './bar'\nimport { CartesianOrientations, ColorClassNameTypes, Events, RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\n\nexport class GroupedBar extends Bar {\n\ttype = 'grouped-bar'\n\trenderType = RenderTypes.SVG\n\n\tgroupScale: ScaleBand<any>\n\n\tpadding = 5\n\n\t// A factor to normalize padding between bars regardless of bar group density.\n\treadonly defaultStepFactor = 70\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events\n\n\t\t// Highlight correct circle on legend item hovers\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\n\t\t// Un-highlight circles on legend item mouseouts\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate: boolean) {\n\t\t// Chart options mixed with the internal configurations\n\t\tconst displayData = this.model.getDisplayData(this.configs.groups)\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\t// Get unique labels\n\t\tthis.setGroupScale()\n\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true })\n\n\t\tconst allDataLabels = uniq(\n\t\t\tdisplayData.map((datum: any) => {\n\t\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(datum)\n\n\t\t\t\treturn datum[domainIdentifier] && typeof datum[domainIdentifier].toString === 'function'\n\t\t\t\t\t? datum[domainIdentifier].toString()\n\t\t\t\t\t: datum[domainIdentifier]\n\t\t\t})\n\t\t)\n\n\t\t// Update data on bar groups\n\t\tconst barGroups = svg.selectAll('g.bars').data(allDataLabels, (label: string) => label)\n\n\t\t// Remove dot groups that need to be removed\n\t\tbarGroups.exit().attr('opacity', 0).remove()\n\n\t\t// Add the bar groups that need to be introduced\n\t\tconst barGroupsEnter = barGroups\n\t\t\t.enter()\n\t\t\t.append('g')\n\t\t\t.classed('bars', true)\n\t\t\t.attr('role', Roles.GROUP)\n\t\t\t.attr('data-name', 'bars')\n\n\t\t// Update data on all bars\n\t\tconst allBarGroups = barGroupsEnter.merge(barGroups as any)\n\n\t\tallBarGroups\n\t\t\t// Transition\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'bar-group-update-enter',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('transform', (label: string) => {\n\t\t\t\tconst scaleValue = this.services.cartesianScales.getDomainValue(label)\n\t\t\t\tconst translateBy = scaleValue - this.getGroupWidth() / 2\n\n\t\t\t\tif (this.services.cartesianScales.getOrientation() === CartesianOrientations.VERTICAL) {\n\t\t\t\t\treturn `translate(${translateBy}, 0)`\n\t\t\t\t} else {\n\t\t\t\t\t// translate in the y direction for horizontal groups\n\t\t\t\t\treturn `translate(0, ${translateBy})`\n\t\t\t\t}\n\t\t\t})\n\n\t\tconst bars = allBarGroups.selectAll('path.bar').data(\n\t\t\t(label: string) => this.getDataCorrespondingToLabel(label),\n\t\t\t(d: any) => d[groupMapsTo]\n\t\t)\n\n\t\t// Remove bars that are no longer needed\n\t\tbars.exit().attr('opacity', 0).remove()\n\n\t\t// Add the bars that need to be introduced\n\t\tconst barsEnter = bars.enter().append('path').attr('opacity', 0)\n\n\t\t// code for vertical grouped bar charts\n\t\tbarsEnter\n\t\t\t.merge(bars as any)\n\t\t\t.classed('bar', true)\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'bar-update-enter',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\toriginalClassName: 'bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('fill', (d: any) => this.model.getFillColor(d[groupMapsTo]))\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\t/*\n\t\t\t\t * Orientation support for horizontal/vertical bar charts\n\t\t\t\t * Determine coordinates needed for a vertical set of paths\n\t\t\t\t * to draw the bars needed, and pass those coordinates down to\n\t\t\t\t * generateSVGPathString() to decide whether it needs to flip them\n\t\t\t\t */\n\t\t\t\tconst startX = this.groupScale(d[groupMapsTo])\n\t\t\t\tconst barWidth = this.getBarWidth()\n\n\t\t\t\tconst x0 = startX\n\t\t\t\tconst x1 = startX + barWidth\n\t\t\t\tconst rangeAxis = this.services.cartesianScales.getRangeAxisPosition({ datum: d })\n\t\t\t\tconst y0 = this.services.cartesianScales.getValueThroughAxisPosition(rangeAxis, 0)\n\t\t\t\tconst y1 = this.services.cartesianScales.getRangeValue(d)\n\n\t\t\t\t// don't show if part of bar is out of zoom domain - test zoom on bar pos, not group\n\t\t\t\tconst zoomx0 = this.services.cartesianScales.getDomainValue(d) - barWidth / 2\n\t\t\t\tconst zoomx1 = zoomx0 + barWidth\n\t\t\t\tif (this.isOutsideZoomedDomain(zoomx0, zoomx1)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\treturn generateSVGPathString(\n\t\t\t\t\t{ x0, x1, y0, y1 },\n\t\t\t\t\tthis.services.cartesianScales.getOrientation()\n\t\t\t\t)\n\t\t\t})\n\t\t\t.attr('opacity', 1)\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'bar')\n\t\t\t.attr('aria-label', (d: any) => d.value)\n\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners()\n\t}\n\n\t// Highlight elements that match the hovered legend item\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\n\t\tconst { groupMapsTo } = this.getOptions().data\n\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.transition('legend-hover-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => (d[groupMapsTo] !== hoveredElement.datum()['name'] ? 0.3 : 1))\n\t}\n\n\t// Un-highlight all elements\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.transition('legend-mouseout-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this\n\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', true)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\tdata: [datum]\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', false)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\tdestroy() {\n\t\t// Remove event listeners\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('mouseout', null)\n\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\tprotected getDataCorrespondingToLabel(label: string) {\n\t\tconst displayData = this.model.getDisplayData(this.configs.groups)\n\n\t\treturn displayData.filter((datum: any) => {\n\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(datum)\n\t\t\treturn datum[domainIdentifier].toString() === label\n\t\t})\n\t}\n\n\tprotected getGroupWidth() {\n\t\tconst activeData = this.model.getGroupedData(this.configs.groups)\n\t\tconst totalGroupPadding = this.getTotalGroupPadding()\n\n\t\treturn this.getBarWidth() * activeData.length + totalGroupPadding\n\t}\n\n\tprotected getDomainScaleStep() {\n\t\tconst domainScale =\n\t\t\tthis.services.cartesianScales.getDomainScale() as unknown as ScaleBand<string>\n\t\tconst activeData = this.model.getGroupedData(this.configs.groups)\n\n\t\tlet step = this.defaultStepFactor\n\t\tif (typeof (domainScale as any).step === 'function') {\n\t\t\tstep = domainScale.step()\n\t\t} else if (activeData.length > 0) {\n\t\t\t// as a fallback use distance between first bars of adjacent bar groups\n\t\t\tconst ref = activeData.find((d: any) => d.data?.length > 1)\n\t\t\tif (ref) {\n\t\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(ref.data[0])\n\t\t\t\tstep = Math.abs(\n\t\t\t\t\tdomainScale(ref.data[1][domainIdentifier]) - domainScale(ref.data[0][domainIdentifier])\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t\treturn step\n\t}\n\n\tprotected getTotalGroupPadding() {\n\t\tconst activeData = this.model.getGroupedData(this.configs.groups)\n\n\t\tif (activeData.length === 1) {\n\t\t\treturn 0\n\t\t}\n\n\t\tconst padding = Math.min(5, 5 * (this.getDomainScaleStep() / this.defaultStepFactor))\n\n\t\treturn padding * (activeData.length - 1)\n\t}\n\n\t// Gets the correct width for bars based on options & configurations\n\tprotected getBarWidth() {\n\t\tconst options = this.getOptions()\n\t\tconst providedWidth = getProperty(options, 'bars', 'width')\n\t\tconst providedMaxWidth = getProperty(options, 'bars', 'maxWidth')\n\n\t\t// If there's a provided width, compare with maxWidth and\n\t\t// Determine which to return\n\t\tif (providedWidth !== null) {\n\t\t\tif (providedMaxWidth === null || providedWidth <= providedMaxWidth) {\n\t\t\t\treturn providedWidth\n\t\t\t}\n\t\t}\n\n\t\tconst activeData = this.model.getGroupedData(this.configs.groups)\n\t\tconst numOfActiveDataGroups = activeData.length\n\t\tconst totalGroupPadding = this.getTotalGroupPadding()\n\n\t\treturn Math.min(\n\t\t\tprovidedMaxWidth,\n\t\t\t(this.getDomainScaleStep() - totalGroupPadding) / numOfActiveDataGroups\n\t\t)\n\t}\n\n\tprotected setGroupScale() {\n\t\tconst activeData = this.model.getActiveDataGroupNames(this.configs.groups)\n\n\t\tthis.groupScale = scaleBand().domain(activeData).rangeRound([0, this.getGroupWidth()])\n\t}\n}\n","import { min, select } from 'd3'\nimport { get } from 'lodash-es'\nimport { getProperty, getTransformOffsets } from '@/tools'\nimport { heatmap as heatmapConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport { Events, RenderTypes, DividerStatus } from '@/interfaces/enums'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { HeatmapModel } from '@/model/heatmap'\n\nexport class Heatmap extends Component {\n\ttype = 'heatmap'\n\trenderType = RenderTypes.SVG\n\n\tprivate matrix: any = {}\n\tprivate xBandwidth = 0\n\tprivate yBandwidth = 0\n\tprivate translationUnits = {\n\t\tx: 0,\n\t\ty: 0\n\t}\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events\n\n\t\t// Highlight correct cells on Axis item hovers\n\t\teventsFragment.addEventListener(Events.Axis.LABEL_MOUSEOVER, this.handleAxisOnHover)\n\n\t\t// Highlight correct cells on Axis item mouseouts\n\t\teventsFragment.addEventListener(Events.Axis.LABEL_MOUSEOUT, this.handleAxisMouseOut)\n\n\t\t// Highlight correct cells on Axis item focus\n\t\teventsFragment.addEventListener(Events.Axis.LABEL_FOCUS, this.handleAxisOnHover)\n\n\t\t// Highlight correct cells on Axis item blur\n\t\teventsFragment.addEventListener(Events.Axis.LABEL_BLUR, this.handleAxisMouseOut)\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true })\n\t\t// Lower the chart so the axes are always visible\n\t\tsvg.lower()\n\n\t\tconst { cartesianScales } = this.services\n\t\tthis.matrix = (this.model as HeatmapModel).getMatrix()\n\n\t\tsvg.html('')\n\n\t\tif (getProperty(this.getOptions(), 'data', 'loading')) {\n\t\t\treturn\n\t\t}\n\n\t\t// determine x and y axis scale\n\t\tconst mainXScale = cartesianScales.getMainXScale()\n\t\tconst mainYScale = cartesianScales.getMainYScale()\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier()\n\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier()\n\n\t\t// Get unique axis values & create a matrix\n\t\tconst uniqueDomain = (this.model as HeatmapModel).getUniqueDomain()\n\t\tconst uniqueRange = (this.model as HeatmapModel).getUniqueRanges()\n\n\t\t// Get matrix in the form of an array to create a single heatmap group\n\t\tconst matrixArray = (this.model as HeatmapModel).getMatrixAsArray()\n\n\t\t// Get available chart area\n\t\tconst xRange = mainXScale.range()\n\t\tconst yRange = mainYScale.range()\n\n\t\t// Determine rectangle dimensions based on the number of unique domain and range\n\t\tthis.xBandwidth = Math.abs((xRange[1] - xRange[0]) / uniqueDomain.length)\n\t\tthis.yBandwidth = Math.abs((yRange[1] - yRange[0]) / uniqueRange.length)\n\n\t\tconst patternID = this.services.domUtils.generateElementIDString(`heatmap-pattern-stripes`)\n\n\t\t// Create a striped pattern for missing data\n\t\tsvg\n\t\t\t.append('defs')\n\t\t\t.append('pattern')\n\t\t\t.attr('id', patternID)\n\t\t\t.attr('width', 3)\n\t\t\t.attr('height', 3)\n\t\t\t.attr('patternUnits', 'userSpaceOnUse')\n\t\t\t.attr('patternTransform', 'rotate(45)')\n\t\t\t.append('rect')\n\t\t\t.classed('pattern-fill', true)\n\t\t\t.attr('width', 0.5)\n\t\t\t.attr('height', 8)\n\n\t\tconst rectangles = svg\n\t\t\t.selectAll()\n\t\t\t.data(matrixArray)\n\t\t\t.enter()\n\t\t\t.append('g')\n\t\t\t.attr('class', (d: any) => `heat-${d.index}`)\n\t\t\t.classed('cell', true)\n\t\t\t.attr(\n\t\t\t\t'transform',\n\t\t\t\t(d: any) =>\n\t\t\t\t\t`translate(${mainXScale(d[domainIdentifier])}, ${mainYScale(d[rangeIdentifier])})`\n\t\t\t)\n\t\t\t.append('rect')\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tvalue: d.value,\n\t\t\t\t\toriginalClassName: `heat-${d.index}`\n\t\t\t\t})\n\t\t\t)\n\t\t\t.classed('heat', true)\n\t\t\t.classed('null-state', (d: any) => (d.index === -1 || d.value === null ? true : false))\n\t\t\t.attr('width', this.xBandwidth)\n\t\t\t.attr('height', this.yBandwidth)\n\t\t\t.style('fill', (d: any) => {\n\t\t\t\t// Check if a valid value exists\n\t\t\t\tif (d.index === -1 || d.value === null) {\n\t\t\t\t\treturn `url(#${patternID})`\n\t\t\t\t}\n\t\t\t\treturn this.model.getFillColor(Number(d.value))\n\t\t\t})\n\t\t\t.attr('aria-label', (d: any) => d.value)\n\n\t\t// Cell highlight box\n\t\tthis.createOuterBox('g.cell-highlight', this.xBandwidth, this.yBandwidth)\n\t\t// Column highlight box\n\t\tthis.createOuterBox(\n\t\t\t'g.multi-cell.column-highlight',\n\t\t\tthis.xBandwidth,\n\t\t\tMath.abs(yRange[1] - yRange[0])\n\t\t)\n\t\t// Row highlight box\n\t\tthis.createOuterBox(\n\t\t\t'g.multi-cell.row-highlight',\n\t\t\tMath.abs(xRange[1] - xRange[0]),\n\t\t\tthis.yBandwidth\n\t\t)\n\n\t\tif (this.determineDividerStatus()) {\n\t\t\trectangles.style('stroke-width', '1px')\n\t\t\tthis.parent.select('g.cell-highlight').classed('cell-2', true)\n\t\t}\n\n\t\tthis.addEventListener()\n\t}\n\n\t/**\n\t * Generates a box using lines to create a hover effect\n\t * The lines have drop shadow in their respective direction\n\t * @param parentTag - tag name\n\t * @param xBandwidth - X length\n\t * @param yBandwidth - y length\n\t */\n\tprivate createOuterBox(parentTag: string, xBandwidth: number, yBandwidth: number) {\n\t\t// Create a highlighter in the parent component so the shadow and the lines do not get clipped\n\t\tconst highlight = DOMUtils.appendOrSelect(this.parent, parentTag)\n\t\t\t.classed('shadows', true)\n\t\t\t.classed('highlighter-hidden', true)\n\n\t\tDOMUtils.appendOrSelect(highlight, 'line.top')\n\t\t\t.attr('x1', -1)\n\t\t\t.attr('x2', xBandwidth + 1)\n\n\t\tDOMUtils.appendOrSelect(highlight, 'line.left')\n\t\t\t.attr('x1', 0)\n\t\t\t.attr('y1', -1)\n\t\t\t.attr('x2', 0)\n\t\t\t.attr('y2', yBandwidth + 1)\n\n\t\tDOMUtils.appendOrSelect(highlight, 'line.down')\n\t\t\t.attr('x1', -1)\n\t\t\t.attr('x2', xBandwidth + 1)\n\t\t\t.attr('y1', yBandwidth)\n\t\t\t.attr('y2', yBandwidth)\n\n\t\tDOMUtils.appendOrSelect(highlight, 'line.right')\n\t\t\t.attr('x1', xBandwidth)\n\t\t\t.attr('x2', xBandwidth)\n\t\t\t.attr('y1', -1)\n\t\t\t.attr('y2', yBandwidth + 1)\n\t}\n\n\tprivate determineDividerStatus(): boolean {\n\t\t// Add dividers if status is not off, will assume auto or on by default.\n\t\tconst dividerStatus = getProperty(this.getOptions(), 'heatmap', 'divider', 'state')\n\n\t\t// Determine if cell divider should be displayed\n\t\tif (dividerStatus !== DividerStatus.OFF) {\n\t\t\tif (\n\t\t\t\t(dividerStatus === DividerStatus.AUTO &&\n\t\t\t\t\theatmapConfigs.minCellDividerDimension <= this.xBandwidth &&\n\t\t\t\t\theatmapConfigs.minCellDividerDimension <= this.yBandwidth) ||\n\t\t\t\tdividerStatus === DividerStatus.ON\n\t\t\t) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t}\n\n\taddEventListener() {\n\t\tconst self = this\n\t\tconst { cartesianScales } = this.services\n\t\tconst options = this.getOptions()\n\t\tconst totalLabel = get(options, 'tooltip.totalLabel')\n\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier()\n\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier()\n\n\t\tconst domainLabel = cartesianScales.getDomainLabel()\n\t\tconst rangeLabel = cartesianScales.getRangeLabel()\n\n\t\tthis.parent\n\t\t\t.selectAll('g.cell')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst cell = select(this)\n\t\t\t\tconst hoveredElement = cell.select('rect.heat')\n\t\t\t\tconst nullState = hoveredElement.classed('null-state')\n\n\t\t\t\t// Dispatch event and tooltip only if value exists\n\t\t\t\tif (!nullState) {\n\t\t\t\t\t// Get transformation value of node\n\t\t\t\t\tconst transform = getTransformOffsets(cell.attr('transform'))\n\n\t\t\t\t\tself.parent\n\t\t\t\t\t\t.select('g.cell-highlight')\n\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t'transform',\n\t\t\t\t\t\t\t`translate(${transform.x + self.translationUnits.x}, ${\n\t\t\t\t\t\t\t\ttransform.y + self.translationUnits.y\n\t\t\t\t\t\t\t})`\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.classed('highlighter-hidden', false)\n\n\t\t\t\t\t// Dispatch mouse over event\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Heatmap.HEATMAP_MOUSEOVER, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\t\tdatum: datum\n\t\t\t\t\t})\n\n\t\t\t\t\t// Dispatch tooltip show event\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\titems: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: domainLabel,\n\t\t\t\t\t\t\t\tvalue: datum[domainIdentifier]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: rangeLabel,\n\t\t\t\t\t\t\t\tvalue: datum[rangeIdentifier]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: totalLabel || 'Total',\n\t\t\t\t\t\t\t\tvalue: datum['value'],\n\t\t\t\t\t\t\t\tcolor: hoveredElement.style('fill')\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse move event\n\t\t\t\tself.services.events.dispatchEvent(Events.Heatmap.HEATMAP_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum: datum\n\t\t\t\t})\n\t\t\t\t// Dispatch tooltip move event\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse click event\n\t\t\t\tself.services.events.dispatchEvent(Events.Heatmap.HEATMAP_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum: datum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst cell = select(this)\n\t\t\t\tconst hoveredElement = cell.select('rect.heat')\n\t\t\t\tconst nullState = hoveredElement.classed('null-state')\n\n\t\t\t\tself.parent.select('g.cell-highlight').classed('highlighter-hidden', true)\n\n\t\t\t\t// Dispatch event and tooltip only if value exists\n\t\t\t\tif (!nullState) {\n\t\t\t\t\t// Dispatch mouse out event\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Heatmap.HEATMAP_MOUSEOUT, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\t\tdatum: datum\n\t\t\t\t\t})\n\n\t\t\t\t\t// Dispatch hide tooltip event\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\thoveredElement\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\t// Highlight elements that match the hovered axis item\n\thandleAxisOnHover = (event: CustomEvent) => {\n\t\tconst { detail } = event\n\t\tconst { datum } = detail\n\t\t// Unique ranges and domains\n\t\tconst ranges = (this.model as HeatmapModel).getUniqueRanges()\n\t\tconst domains = (this.model as HeatmapModel).getUniqueDomain()\n\t\t// Labels\n\t\tconst domainLabel = this.services.cartesianScales.getDomainLabel()\n\t\tconst rangeLabel = this.services.cartesianScales.getRangeLabel()\n\t\t// Scales\n\t\tconst mainXScale = this.services.cartesianScales.getMainXScale()\n\t\tconst mainYScale = this.services.cartesianScales.getMainYScale()\n\n\t\tlet label = '',\n\t\t\tsum: any = null,\n\t\t\tminimum: any = null,\n\t\t\tmaximum: any = null\n\n\t\t// Check to see where datum belongs\n\t\tif (this.matrix[datum] !== undefined) {\n\t\t\tlabel = domainLabel\n\t\t\t// Iterate through Object and get sum, min, and max\n\t\t\tranges.forEach((element: any) => {\n\t\t\t\tif (typeof this.matrix[datum][element].value === 'number') {\n\t\t\t\t\tconst value = this.matrix[datum][element].value\n\t\t\t\t\tif (sum === null) {\n\t\t\t\t\t\tsum = value\n\t\t\t\t\t\tminimum = value\n\t\t\t\t\t\tmaximum = value\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tsum += value\n\t\t\t\t\tminimum = value < minimum ? value : minimum\n\t\t\t\t\tmaximum = value > maximum ? value : maximum\n\t\t\t\t}\n\t\t\t})\n\t\t} else {\n\t\t\tlabel = rangeLabel\n\t\t\tdomains.forEach((element: any) => {\n\t\t\t\tif (typeof this.matrix[element][datum].value === 'number') {\n\t\t\t\t\tconst value = this.matrix[element][datum].value\n\t\t\t\t\tif (sum === null) {\n\t\t\t\t\t\tsum = value\n\t\t\t\t\t\tminimum = value\n\t\t\t\t\t\tmaximum = value\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tsum += value\n\t\t\t\t\tminimum = value < minimum ? value : minimum\n\t\t\t\t\tmaximum = value > maximum ? value : maximum\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tif (mainXScale(datum) !== undefined) {\n\t\t\tthis.parent\n\t\t\t\t.select('g.multi-cell.column-highlight')\n\t\t\t\t.classed('highlighter-hidden', false)\n\t\t\t\t.attr('transform', `translate(${mainXScale(datum)}, ${min(mainYScale.range())})`)\n\t\t} else if (mainYScale(datum) !== undefined) {\n\t\t\tthis.parent\n\t\t\t\t.select('g.multi-cell.row-highlight')\n\t\t\t\t.classed('highlighter-hidden', false)\n\t\t\t\t.attr('transform', `translate(${min(mainXScale.range())},${mainYScale(datum)})`)\n\t\t}\n\n\t\t// Dispatch tooltip show event\n\t\tthis.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\tevent: detail.event,\n\t\t\thoveredElement: select(event.detail.element),\n\t\t\titems: [\n\t\t\t\t{\n\t\t\t\t\tlabel: label,\n\t\t\t\t\tvalue: datum,\n\t\t\t\t\tbold: true\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Min',\n\t\t\t\t\tvalue: minimum !== null ? minimum : '-'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Max',\n\t\t\t\t\tvalue: maximum !== null ? maximum : '-'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Average',\n\t\t\t\t\tvalue: sum !== null ? sum / domains.length : '-'\n\t\t\t\t}\n\t\t\t]\n\t\t})\n\t}\n\n\t// Un-highlight all elements\n\thandleAxisMouseOut = (event: CustomEvent) => {\n\t\t// Hide column/row\n\t\tthis.parent.selectAll('g.multi-cell').classed('highlighter-hidden', true)\n\n\t\t// Dispatch hide tooltip event\n\t\tthis.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\tevent\n\t\t})\n\t}\n\n\t// Remove event listeners\n\tdestroy() {\n\t\tthis.parent\n\t\t\t.selectAll('rect.heat')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('click', null)\n\t\t\t.on('mouseout', null)\n\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleAxisOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleAxisMouseOut)\n\t}\n}\n","import { select } from 'd3'\nimport { get } from 'lodash-es'\nimport { generateSVGPathString, getProperty } from '@/tools'\nimport { Events, CartesianOrientations, ColorClassNameTypes, RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\nimport { Component } from '@/components/component'\n\nexport class Histogram extends Component {\n\ttype = 'histogram'\n\trenderType = RenderTypes.SVG\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events\n\n\t\t// Highlight correct circle on legend item hovers\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\n\t\t// Un-highlight circles on legend item mouseouts\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate: boolean) {\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer()\n\n\t\t// Chart options mixed with the internal configurations\n\t\tconst options = this.model.getOptions()\n\t\tconst { groupIdentifier } = options\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst binnedStackedData = this.model.getBinnedStackedData()\n\n\t\tconst x = this.services.cartesianScales.getMainXScale()\n\n\t\t// Update data on all bar groups\n\t\tconst barGroups = svg\n\t\t\t.selectAll('g.bars')\n\t\t\t.data(binnedStackedData, (d: any) => get(d, `0.${groupMapsTo}`))\n\n\t\tbarGroups.exit().attr('opacity', 0).remove()\n\n\t\t// Add bar groups that need to be introduced\n\t\tbarGroups.enter().append('g').classed('bars', true).attr('role', Roles.GROUP)\n\n\t\t// Update data on all bars\n\t\tconst bars = svg\n\t\t\t.selectAll('g.bars')\n\t\t\t.selectAll('path.bar')\n\t\t\t.data((data: any) => data)\n\n\t\t// Remove bars that need to be removed\n\t\tbars.exit().remove()\n\n\t\tbars\n\t\t\t.enter()\n\t\t\t.append('path')\n\t\t\t.merge(bars as any)\n\t\t\t.classed('bar', true)\n\t\t\t.attr(groupIdentifier, (_: any, i: number) => i)\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'histogram-bar-update-enter',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\toriginalClassName: 'bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('fill', (d: any) => this.model.getFillColor(d[groupMapsTo]))\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\tconst bin = get(d, 'data')\n\n\t\t\t\tif (!bin) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t * Orientation support for horizontal/vertical bar charts\n\t\t\t\t * Determine coordinates needed for a vertical set of paths\n\t\t\t\t * to draw the bars needed, and pass those coordinates down to\n\t\t\t\t * generateSVGPathString() to decide whether it needs to flip them\n\t\t\t\t */\n\t\t\t\tconst barWidth = x(bin.x1) - x(bin.x0) - 1\n\t\t\t\tconst x0 = this.services.cartesianScales.getDomainValue(bin.x0) as number\n\t\t\t\tconst x1 = x0 + barWidth\n\n\t\t\t\tconst y0 = this.services.cartesianScales.getRangeValue(d[0]) as number\n\t\t\t\tlet y1 = this.services.cartesianScales.getRangeValue(d[1]) as number\n\n\t\t\t\t// Add the divider gap\n\t\t\t\tif (Math.abs(y1 - y0) > 0 && Math.abs(y1 - y0) > options.bars.dividerSize) {\n\t\t\t\t\tif (this.services.cartesianScales.getOrientation() === CartesianOrientations.VERTICAL) {\n\t\t\t\t\t\ty1 += 1\n\t\t\t\t\t} else {\n\t\t\t\t\t\ty1 -= 1\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn generateSVGPathString(\n\t\t\t\t\t{ x0, x1, y0, y1 },\n\t\t\t\t\tthis.services.cartesianScales.getOrientation()\n\t\t\t\t)\n\t\t\t})\n\t\t\t.attr('opacity', 1)\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'bar')\n\t\t\t.attr('aria-label', (d: any) => getProperty(d, 'data', d[groupMapsTo]))\n\n\t\t// Add event listeners for the above elements\n\t\tthis.addEventListeners()\n\t}\n\n\t// Highlight elements that match the hovered legend item\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.transition('legend-hover-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => (d[groupMapsTo] !== hoveredElement.datum()['name'] ? 0.3 : 1))\n\t}\n\n\t// Un-highlight all elements\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.transition('legend-mouseout-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\taddEventListeners() {\n\t\tconst options = this.model.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst self = this\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\thoveredElement.classed('hovered', true)\n\n\t\t\t\tconst x0 = parseFloat(get(datum, 'data.x0'))\n\t\t\t\tconst x1 = parseFloat(get(datum, 'data.x1'))\n\n\t\t\t\tconst rangeAxisPosition = self.services.cartesianScales.getRangeAxisPosition()\n\t\t\t\tconst rangeScaleLabel = self.services.cartesianScales.getScaleLabel(rangeAxisPosition)\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: get(options, 'bins.rangeLabel') || 'Range',\n\t\t\t\t\t\t\tvalue: `${x0} – ${x1}`\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: options.tooltip.groupLabel || 'Group',\n\t\t\t\t\t\t\tvalue: datum[groupMapsTo],\n\t\t\t\t\t\t\tclass: self.model.getColorClassName({\n\t\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.TOOLTIP],\n\t\t\t\t\t\t\t\tdataGroupName: datum[groupMapsTo]\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: rangeScaleLabel,\n\t\t\t\t\t\t\tvalue: get(datum, `data.${datum[groupMapsTo]}`)\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent) {\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function () {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Select all same group elements\n\t\t\t\thoveredElement.classed('hovered', false)\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE)\n\t\t\t})\n\t}\n\n\tdestroy() {\n\t\t// Remove event listeners\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('mouseout', null)\n\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n}\n","import { flipDomainAndRangeBasedOnOrientation } from '@/tools'\nimport { lines as lineConfigs } from '@/configuration'\nimport { Scatter } from './scatter'\nimport { CartesianOrientations, ColorClassNameTypes, Events, RenderTypes } from '@/interfaces/enums'\n\nexport class Lollipop extends Scatter {\n\ttype = 'lollipop'\n\trenderType = RenderTypes.SVG\n\n\tinit() {\n\t\tconst { events } = this.services\n\t\t// Highlight correct line legend item hovers\n\t\tevents.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\t// Un-highlight lines on legend item mouseouts\n\t\tevents.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate: boolean) {\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true })\n\n\t\tconst options = this.model.getOptions()\n\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst { cartesianScales } = this.services\n\t\tconst mainXScale = cartesianScales.getMainXScale()\n\t\tconst mainYScale = cartesianScales.getMainYScale()\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier()\n\n\t\tconst getDomainValue = (d: any) => cartesianScales.getDomainValue(d)\n\t\tconst getRangeValue = (d: any) => cartesianScales.getRangeValue(d)\n\t\tconst orientation = cartesianScales.getOrientation()\n\t\tconst [getXValue, getYValue] = flipDomainAndRangeBasedOnOrientation(\n\t\t\tgetDomainValue,\n\t\t\tgetRangeValue,\n\t\t\torientation\n\t\t)\n\n\t\t// Update data on lines\n\t\tconst lines = svg\n\t\t\t.selectAll('line.line')\n\t\t\t.data(\n\t\t\t\tthis.getScatterData(),\n\t\t\t\t(datum: any) => `${datum[groupMapsTo]}-${datum[domainIdentifier]}`\n\t\t\t)\n\n\t\t// Remove lines that are no longer needed\n\t\tlines.exit().attr('opacity', 0).remove()\n\n\t\t// Remove lines that need to be removed\n\t\tconst enteringLines = lines.enter().append('line').attr('opacity', 0)\n\n\t\tconst allLines = enteringLines\n\t\t\t.merge(lines as any)\n\t\t\t.classed('line', true)\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\toriginalClassName: 'line'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'lollipop-line-update-enter',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('stroke', (d: any) => this.model.getFillColor(d[groupMapsTo], d[domainIdentifier], d))\n\t\t\t.attr('opacity', 1)\n\n\t\tif (orientation === CartesianOrientations.HORIZONTAL) {\n\t\t\tallLines\n\t\t\t\t.attr('y1', getYValue)\n\t\t\t\t.attr('y2', getYValue)\n\t\t\t\t.attr('x1', mainXScale.range()[0])\n\t\t\t\t.attr('x2', (d: any) => (getXValue(d) as any) - options.points.radius)\n\t\t} else {\n\t\t\tallLines\n\t\t\t\t.attr('x1', getXValue)\n\t\t\t\t.attr('x2', getXValue)\n\t\t\t\t.attr('y1', mainYScale.range()[0])\n\t\t\t\t.attr('y2', (d: any) => getYValue(d) + options.points.radius)\n\t\t}\n\n\t\tthis.addScatterPointEventListeners()\n\t}\n\n\t// listen for when individual datapoints are hovered\n\taddScatterPointEventListeners() {\n\t\t// Highlight correct line associated when hovering on a scatter point\n\t\tthis.services.events.addEventListener(\n\t\t\tEvents.Scatter.SCATTER_MOUSEOVER,\n\t\t\tthis.handleScatterOnHover\n\t\t)\n\n\t\t// unbolden the line when not hovered on the lollipop scatter point\n\t\tthis.services.events.addEventListener(\n\t\t\tEvents.Scatter.SCATTER_MOUSEOUT,\n\t\t\tthis.handleScatterOnMouseOut\n\t\t)\n\t}\n\n\t// on hover, bolden the line associated with the scatter\n\thandleScatterOnHover = (event: CustomEvent) => {\n\t\tconst hoveredElement = event.detail\n\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tthis.parent.selectAll('line.line').attr('stroke-width', (d: any) => {\n\t\t\tif (d[groupMapsTo] !== hoveredElement.datum[groupMapsTo]) {\n\t\t\t\treturn lineConfigs.weight.unselected\n\t\t\t}\n\t\t\t// apply selected weight\n\t\t\treturn lineConfigs.weight.selected\n\t\t})\n\t}\n\n\t// on mouse out remove the stroke width assertion\n\thandleScatterOnMouseOut = () => {\n\t\tthis.parent.selectAll('line.line').attr('stroke-width', lineConfigs.weight.unselected)\n\t}\n\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tthis.parent\n\t\t\t.selectAll('line.line')\n\t\t\t.transition('legend-hover-line')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-line'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => {\n\t\t\t\tif (d[groupMapsTo] !== hoveredElement.datum()['name']) {\n\t\t\t\t\treturn lineConfigs.opacity.unselected\n\t\t\t\t}\n\n\t\t\t\treturn lineConfigs.opacity.selected\n\t\t\t})\n\t}\n\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('line.line')\n\t\t\t.transition('legend-mouseout-line')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-line'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', lineConfigs.opacity.selected)\n\t}\n\n\tdestroy() {\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\n\t\t// remove scatter listeners\n\t\teventsFragment.removeEventListener(Events.Scatter.SCATTER_MOUSEOVER, this.handleScatterOnHover)\n\t\teventsFragment.removeEventListener(\n\t\t\tEvents.Scatter.SCATTER_MOUSEOUT,\n\t\t\tthis.handleScatterOnMouseOut\n\t\t)\n\t}\n}\n","import { scaleLinear, select } from 'd3'\nimport { getProperty } from '@/tools'\nimport { meter as meterConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { ColorClassNameTypes, Events, RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\nimport { MeterChartModel } from '@/model/meter'\n\nexport class Meter extends Component {\n\ttype = 'meter'\n\trenderType = RenderTypes.SVG\n\n\tgetStackedBounds(data: any, scale: any) {\n\t\tlet prevX = 0\n\t\tconst stackedData = data.map((d: any, i: number) => {\n\t\t\tif (i !== 0) {\n\t\t\t\tprevX += scale(d.value)\n\t\t\t\treturn {\n\t\t\t\t\t...d,\n\t\t\t\t\twidth: Math.abs(scale(d.value) - meterConfigs.dividerWidth),\n\t\t\t\t\tx: prevX - scale(d.value)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprevX = scale(d.value)\n\t\t\t\treturn {\n\t\t\t\t\t...d,\n\t\t\t\t\twidth: Math.abs(scale(d.value) - meterConfigs.dividerWidth),\n\t\t\t\t\tx: 0\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\treturn stackedData\n\t}\n\n\trender(animate = true) {\n\t\tconst self = this\n\t\tconst svg = this.getComponentContainer()\n\t\tconst options = this.getOptions()\n\t\tconst proportional = getProperty(options, 'meter', 'proportional')\n\t\tconst data = this.model.getDisplayData()\n\t\tconst status = this.model.getStatus()\n\n\t\tconst { width } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tconst { groupMapsTo } = options.data\n\n\t\tlet domainMax: number\n\t\tif (getProperty(options, 'meter', 'proportional') === null) {\n\t\t\tdomainMax = 100\n\t\t} else {\n\t\t\tconst total = getProperty(options, 'meter', 'proportional', 'total')\n\t\t\tdomainMax = total\n\t\t\t\t? total\n\t\t\t\t: (this.model as MeterChartModel).getMaximumDomain(this.model.getDisplayData())\n\t\t}\n\n\t\t// each meter has a scale for the value but no visual axis\n\t\tconst xScale = scaleLinear().domain([0, domainMax]).range([0, width])\n\t\tconst stackedData = this.getStackedBounds(data, xScale)\n\n\t\tconst userProvidedHeight = getProperty(options, 'meter', 'height')\n\n\t\t// draw the container to hold the value\n\t\tDOMUtils.appendOrSelect(svg, 'rect.container')\n\t\t\t.attr('x', 0)\n\t\t\t.attr('y', 0)\n\t\t\t.attr('width', width)\n\t\t\t.attr(\n\t\t\t\t'height',\n\t\t\t\tuserProvidedHeight\n\t\t\t\t\t? userProvidedHeight\n\t\t\t\t\t: proportional\n\t\t\t\t\t\t? meterConfigs.height.proportional\n\t\t\t\t\t\t: meterConfigs.height.default\n\t\t\t)\n\n\t\t// draw the container max range value indicator\n\t\tDOMUtils.appendOrSelect(svg, 'line.rangeIndicator')\n\t\t\t.attr('x1', width)\n\t\t\t.attr('x2', width)\n\t\t\t.attr('y1', 0)\n\t\t\t.attr(\n\t\t\t\t'y2',\n\t\t\t\tuserProvidedHeight\n\t\t\t\t\t? userProvidedHeight\n\t\t\t\t\t: proportional\n\t\t\t\t\t\t? meterConfigs.height.proportional\n\t\t\t\t\t\t: meterConfigs.height.default\n\t\t\t)\n\n\t\t// rect with the value binded\n\t\tconst valued = svg.selectAll('rect.value').data(stackedData)\n\n\t\t// if user provided a color for the bar, we dont want to attach a status class\n\t\tconst className =\n\t\t\tstatus != null && !self.model.isUserProvidedColorScaleValid() && !proportional\n\t\t\t\t? `value status--${status}`\n\t\t\t\t: 'value'\n\n\t\t// draw the value bar\n\t\tvalued\n\t\t\t.enter()\n\t\t\t.append('rect')\n\t\t\t.classed('value', true)\n\t\t\t.merge(valued as any)\n\t\t\t.attr('x', (d: any) => {\n\t\t\t\treturn d.x\n\t\t\t})\n\t\t\t.attr('y', 0)\n\t\t\t.attr('height', () => {\n\t\t\t\treturn userProvidedHeight\n\t\t\t\t\t? userProvidedHeight\n\t\t\t\t\t: proportional\n\t\t\t\t\t\t? meterConfigs.height.proportional\n\t\t\t\t\t\t: meterConfigs.height.default\n\t\t\t})\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\toriginalClassName: className\n\t\t\t\t})\n\t\t\t)\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'meter-bar-update',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('width', (d: any) => {\n\t\t\t\treturn d.value > domainMax ? xScale(domainMax) : d.width\n\t\t\t})\n\t\t\t.style('fill', (d: any) => self.model.getFillColor(d[groupMapsTo]))\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'value')\n\t\t\t.attr('aria-label', (d: any) => d.value)\n\n\t\tvalued.exit().remove()\n\n\t\t// draw the peak\n\t\tconst peakValue = getProperty(options, 'meter', 'peak')\n\n\t\tlet peakData = peakValue\n\t\tif (peakValue !== null) {\n\t\t\tif (peakValue > domainMax) {\n\t\t\t\tpeakData = domainMax\n\t\t\t} else if (peakValue < data[0].value) {\n\t\t\t\tpeakData = data[0].value > domainMax ? domainMax : data[0].value\n\t\t\t}\n\t\t}\n\n\t\t// if a peak is supplied within the domain, we want to render it\n\t\tconst peak = svg.selectAll('line.peak').data(peakData == null ? [] : [peakData])\n\n\t\tpeak\n\t\t\t.enter()\n\t\t\t.append('line')\n\t\t\t.classed('peak', true)\n\t\t\t.merge(peak as any)\n\t\t\t.attr('y1', 0)\n\t\t\t.attr('y2', () => {\n\t\t\t\treturn userProvidedHeight\n\t\t\t\t\t? userProvidedHeight\n\t\t\t\t\t: proportional\n\t\t\t\t\t\t? meterConfigs.height.proportional\n\t\t\t\t\t\t: meterConfigs.height.default\n\t\t\t})\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'peak-line-update',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('x1', (d: any) => xScale(d))\n\t\t\t.attr('x2', (d: any) => xScale(d))\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'peak')\n\t\t\t.attr('aria-label', (d: any) => d)\n\n\t\tpeak.exit().remove()\n\n\t\t// this forces the meter chart to only take up as much height as needed (if no height is provided)\n\t\tthis.services.domUtils.setSVGMaxHeight()\n\n\t\t// Add event listeners to elements and legend\n\t\tthis.addEventListeners()\n\t}\n\n\t// add event listeners for tooltips on proportional meter bars\n\taddEventListeners() {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst self = this\n\t\tconst proportional = getProperty(options, 'meter', 'proportional')\n\n\t\tthis.parent\n\t\t\t.selectAll('rect.value')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Meter.METER_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tif (proportional) {\n\t\t\t\t\thoveredElement.classed('hovered', true)\n\n\t\t\t\t\t// Show tooltip\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\thoveredElement,\n\t\t\t\t\t\titems: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: datum[groupMapsTo],\n\t\t\t\t\t\t\t\tvalue: datum.value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Meter.METER_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tif (proportional) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\t\tevent\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Meter.METER_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Meter.METER_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tif (proportional) {\n\t\t\t\t\thoveredElement.classed('hovered', false)\n\n\t\t\t\t\t// Hide tooltip\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\t\thoveredElement\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\tdestroy() {\n\t\t// Remove event listeners\n\t\tthis.parent\n\t\t\t.selectAll('rect.value')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('mouseout', null)\n\t\t\t.on('click', null)\n\t}\n}\n","import { TextAnchor, DominantBaseline } from '@/interfaces/enums'\n\nexport interface Point {\n\tx: number\n\ty: number\n}\n\nexport type Angle = number\n\nexport interface LabelAlignment {\n\ttextAnchor: TextAnchor\n\tdominantBaseline: DominantBaseline\n}\n\nexport function radialLabelPlacement(angleRadians: Angle): LabelAlignment {\n\tconst angle = mod(radToDeg(angleRadians), 360)\n\n\tif (isInRange(angle, [0, 10]) || isInRange(angle, [350, 0])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.START,\n\t\t\tdominantBaseline: DominantBaseline.MIDDLE\n\t\t}\n\t} else if (isInRange(angle, [10, 80])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.START,\n\t\t\tdominantBaseline: DominantBaseline.HANGING\n\t\t}\n\t} else if (isInRange(angle, [80, 100])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.MIDDLE,\n\t\t\tdominantBaseline: DominantBaseline.HANGING\n\t\t}\n\t} else if (isInRange(angle, [100, 170])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.END,\n\t\t\tdominantBaseline: DominantBaseline.HANGING\n\t\t}\n\t} else if (isInRange(angle, [170, 190])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.END,\n\t\t\tdominantBaseline: DominantBaseline.MIDDLE\n\t\t}\n\t} else if (isInRange(angle, [190, 260])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.END,\n\t\t\tdominantBaseline: DominantBaseline.BASELINE\n\t\t}\n\t} else if (isInRange(angle, [260, 280])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.MIDDLE,\n\t\t\tdominantBaseline: DominantBaseline.BASELINE\n\t\t}\n\t} else {\n\t\t// 280 - 350\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.START,\n\t\t\tdominantBaseline: DominantBaseline.BASELINE\n\t\t}\n\t}\n}\n\nfunction mod(n: number, m: number) {\n\treturn ((n % m) + m) % m\n}\n\nfunction isInRange(x: number, [min, max]: [number, number]) {\n\treturn x >= min && x <= max\n}\n\nexport function radToDeg(rad: Angle): Angle {\n\treturn rad * (180 / Math.PI)\n}\n\nexport function degToRad(deg: Angle): Angle {\n\treturn deg * (Math.PI / 180)\n}\n\nexport function polarToCartesianCoords(a: Angle, r: number, t: Point = { x: 0, y: 0 }): Point {\n\tconst x = r * Math.cos(a) + t.x\n\tconst y = r * Math.sin(a) + t.y\n\n\t// NaN is rendered at coordinate 0 in browsers\n\t// By setting it to 0, further operations can be performed\n\treturn { x: isNaN(x) ? 0 : x, y: isNaN(y) ? 0 : y }\n}\n\n// Return the distance between a point (described with polar coordinates)\n// on a circumference and the vertical diameter.\n// If the point is on the left if the diameter, its distance is positive,\n// if it is on the right of the diameter, its distance is negative.\nexport function distanceBetweenPointOnCircAndVerticalDiameter(a: Angle, r: number) {\n\treturn r * Math.sin(a - Math.PI / 2)\n}\n","import {\n\tcurveLinearClosed,\n\textent,\n\tlineRadial,\n\tmax,\n\tmin,\n\tscaleBand,\n\tscaleLinear,\n\tselect,\n\ttype Selection as D3Selection,\n\ttype Transition\n} from 'd3'\nimport { flatMapDeep, kebabCase, merge } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { radar as radarConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { Events, ColorClassNameTypes, RenderTypes, Alignments } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\nimport {\n\tPoint,\n\tAngle,\n\tradialLabelPlacement,\n\tradToDeg,\n\tpolarToCartesianCoords,\n\tdistanceBetweenPointOnCircAndVerticalDiameter\n} from '@/services/angle-utils'\n\nexport class Radar extends Component {\n\ttype = 'radar'\n\trenderType = RenderTypes.SVG\n\n\tsvg: SVGElement\n\tgroupMapsTo: string\n\tuniqueKeys: string[]\n\tuniqueGroups: string[]\n\tfullDataNormalized: any\n\tgroupedDataNormalized: any\n\n\tinit() {\n\t\tconst { events } = this.services\n\t\t// Highlight correct line legend item hovers\n\t\tevents.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\t// Un-highlight lines on legend item mouseouts\n\t\tevents.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer()\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tconst data = this.model.getData()\n\t\tconst groupedData = this.model.getGroupedData()\n\n\t\tconst options = this.getOptions()\n\n\t\tconst groupMapsTo = getProperty(options, 'data', 'groupMapsTo')\n\t\tconst valueMapsTo = getProperty(options, 'radar', 'axes', 'value')\n\n\t\tconst { angle, value } = getProperty(options, 'radar', 'axes')\n\n\t\tconst { xLabelPadding, yLabelPadding, yTicksNumber, minRange, xAxisRectHeight } = radarConfigs\n\n\t\tthis.uniqueKeys = Array.from(new Set(data.map((d: any) => d[angle])))\n\t\tthis.uniqueGroups = Array.from(new Set(data.map((d: any) => d[groupMapsTo])))\n\t\tthis.fullDataNormalized = this.normalizeFlatData(data)\n\t\tthis.groupedDataNormalized = this.normalizeGroupedData(groupedData)\n\n\t\tconst labelHeight = this.getLabelDimensions(this.uniqueKeys[0]).height\n\t\tconst margin = 2 * (labelHeight + yLabelPadding)\n\t\tconst size = Math.min(width, height)\n\t\tconst diameter = size - margin\n\t\tconst radius = diameter / 2\n\n\t\tif (radius <= 0) {\n\t\t\treturn\n\t\t}\n\n\t\t// given a key, return the corresponding angle in radiants\n\t\t// rotated by -PI/2 because we want angle 0° at -y (12 o’clock)\n\t\tconst xScale = scaleBand<string>()\n\t\t\t.domain(this.fullDataNormalized.map((d: any) => d[angle]))\n\t\t\t.range([0, 2 * Math.PI].map((a: number) => a - Math.PI / 2) as [Angle, Angle])\n\n\t\tconst centerPointMinValue = min(this.fullDataNormalized.map((d: any) => d[value]) as number[])\n\t\tconst yScale = scaleLinear()\n\t\t\t.domain([\n\t\t\t\tcenterPointMinValue >= 0 ? 0 : centerPointMinValue,\n\t\t\t\tmax(this.fullDataNormalized.map((d: any) => d[value]) as number[])\n\t\t\t])\n\t\t\t.range([minRange, radius])\n\t\t\t.nice(yTicksNumber)\n\t\tconst yTicks = yScale.ticks(yTicksNumber)\n\n\t\tconst colorScale = (group: string): string => this.model.getFillColor(group)\n\n\t\t// constructs a new radial line generator\n\t\t// the angle accessor returns the angle in radians with 0° at -y (12 o’clock)\n\t\t// so map back the angle\n\t\tconst radialLineGenerator = lineRadial<any>()\n\t\t\t.angle((d: any) => xScale(d[angle]) + Math.PI / 2)\n\t\t\t.radius((d: any) => yScale(d[value]))\n\t\t\t.curve(curveLinearClosed)\n\n\t\t// compute the space that each x label needs\n\t\tconst horizSpaceNeededByEachXLabel = this.uniqueKeys.map((key: any) => {\n\t\t\tconst tickWidth = this.getLabelDimensions(key).width\n\t\t\t// compute the distance between the point that the label rapresents and the vertical diameter\n\t\t\tconst distanceFromDiameter = distanceBetweenPointOnCircAndVerticalDiameter(\n\t\t\t\txScale(key),\n\t\t\t\tradius\n\t\t\t)\n\t\t\t// the space each label occupies is the sum of these two values\n\t\t\treturn tickWidth + distanceFromDiameter\n\t\t})\n\t\tconst leftPadding = max(horizSpaceNeededByEachXLabel)\n\n\t\t// center coordinates\n\t\tconst c: Point = {\n\t\t\tx: leftPadding + xLabelPadding,\n\t\t\ty: height / 2\n\t\t}\n\n\t\t/////////////////////////////\n\t\t// Drawing the radar\n\t\t/////////////////////////////\n\n\t\t// y axes\n\t\tconst yAxes = DOMUtils.appendOrSelect(svg, 'g.y-axes').attr('role', Roles.GROUP)\n\t\tconst yAxisUpdate = yAxes.selectAll('path').data(yTicks, (tick: any) => tick)\n\t\t// for each tick, create array of data corresponding to the points composing the shape\n\t\tconst shapeData = (tick: number) =>\n\t\t\tthis.uniqueKeys.map((key: any) => ({ [angle]: key, [value]: tick }))\n\t\tyAxisUpdate.join(\n\t\t\t(enter: any) =>\n\t\t\t\tenter\n\t\t\t\t\t.append('path')\n\t\t\t\t\t.attr('opacity', 0)\n\t\t\t\t\t.attr('transform', `translate(${c.x}, ${c.y})`)\n\t\t\t\t\t.attr('fill', 'none')\n\t\t\t\t\t.call((selection: D3Selection<Element, any, Element, any>) =>\n\t\t\t\t\t\tselection\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t \tBUG (D3): when \"Radar - Missing datapoints\" is displayed, the path that represents the third\n\t\t\t\t\t\t\tblob (shaded area for Water) generates a d=\"M0,-59L118.248,-38.421L29.879,41.125L-25.079,34.518LNaN,NaNZ\"\n\t\t\t\t\t\t\tvalue because of the intentionally missing datapoint for the path (other paths have 5 points, this one has 4).\n\t\t\t\t\t\t\tIn this case, D3 should generate a d=\"M0,-59L118.248,-38.421L29.879,41.125L-25.079,34.518\". Because the path ends\n\t\t\t\t\t\t\twith \"LNaN,NaNZ\", browsers render the path up to that point creating the desired look but\n\t\t\t\t\t\t\tcausing D3 to throw an error (that we cannot catch because it's async). The error fires on\n\t\t\t\t\t\t\td3-transition/src/transition/attrTween.js:5 (but it's a long call-chain).\n\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t\t.call((t: Transition<Element, any, Element, any>) =>\n\t\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\t\tname: 'radar_y_axes_enter',\n\t\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.attr('opacity', 1)\n\t\t\t\t\t\t\t.attr('d', (tick: number) => radialLineGenerator(shapeData(tick)))\n\t\t\t\t\t),\n\t\t\t(update: any) =>\n\t\t\t\tupdate.call((selection: any) =>\n\t\t\t\t\tselection\n\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\tname: 'radar_y_axes_update',\n\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.attr('opacity', 1)\n\t\t\t\t\t\t.attr('transform', `translate(${c.x}, ${c.y})`)\n\t\t\t\t\t\t.attr('d', (tick: any) => radialLineGenerator(shapeData(tick)))\n\t\t\t\t),\n\t\t\t(exit: any) =>\n\t\t\t\texit.call((selection: any) =>\n\t\t\t\t\tselection\n\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\tname: 'radar_y_axes_exit',\n\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.attr('d', (tick: any) => radialLineGenerator(shapeData(tick)))\n\t\t\t\t\t\t.attr('opacity', 0)\n\t\t\t\t\t\t.remove()\n\t\t\t\t)\n\t\t)\n\n\t\t// x axes\n\t\tconst xAxes = DOMUtils.appendOrSelect(svg, 'g.x-axes').attr('role', Roles.GROUP)\n\t\tconst xAxisUpdate = xAxes.selectAll('line').data(this.uniqueKeys, (key: any) => key)\n\t\txAxisUpdate.join(\n\t\t\t(enter: any) =>\n\t\t\t\tenter\n\t\t\t\t\t.append('line')\n\t\t\t\t\t.attr('opacity', 0)\n\t\t\t\t\t.attr('class', (key: any) => `x-axis-${kebabCase(key)}`) // replace spaces with -\n\t\t\t\t\t.attr('stroke-dasharray', '0')\n\t\t\t\t\t.attr('x1', (key: any) => polarToCartesianCoords(xScale(key), 0, c).x)\n\t\t\t\t\t.attr('y1', (key: any) => polarToCartesianCoords(xScale(key), 0, c).y)\n\t\t\t\t\t.attr('x2', (key: any) => polarToCartesianCoords(xScale(key), 0, c).x)\n\t\t\t\t\t.attr('y2', (key: any) => polarToCartesianCoords(xScale(key), 0, c).y)\n\t\t\t\t\t.call((selection: any) =>\n\t\t\t\t\t\tselection\n\t\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\t\tname: 'radar_x_axes_enter',\n\t\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.attr('opacity', 1)\n\t\t\t\t\t\t\t.attr('x1', (key: any) => polarToCartesianCoords(xScale(key), yScale.range()[0], c).x)\n\t\t\t\t\t\t\t.attr('y1', (key: any) => polarToCartesianCoords(xScale(key), yScale.range()[0], c).y)\n\t\t\t\t\t\t\t.attr('x2', (key: any) => polarToCartesianCoords(xScale(key), yScale.range()[1], c).x)\n\t\t\t\t\t\t\t.attr('y2', (key: any) => polarToCartesianCoords(xScale(key), yScale.range()[1], c).y)\n\t\t\t\t\t),\n\t\t\t(update: any) =>\n\t\t\t\tupdate.call((selection: any) =>\n\t\t\t\t\tselection\n\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\tname: 'radar_x_axes_update',\n\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.attr('opacity', 1)\n\t\t\t\t\t\t.attr('x1', (key: any) => polarToCartesianCoords(xScale(key), yScale.range()[0], c).x)\n\t\t\t\t\t\t.attr('y1', (key: any) => polarToCartesianCoords(xScale(key), yScale.range()[0], c).y)\n\t\t\t\t\t\t.attr('x2', (key: any) => polarToCartesianCoords(xScale(key), yScale.range()[1], c).x)\n\t\t\t\t\t\t.attr('y2', (key: any) => polarToCartesianCoords(xScale(key), yScale.range()[1], c).y)\n\t\t\t\t),\n\t\t\t(exit: any) =>\n\t\t\t\texit.call((selection: any) =>\n\t\t\t\t\tselection\n\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\tname: 'radar_x_axes_exit',\n\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.attr('opacity', 0)\n\t\t\t\t\t\t.remove()\n\t\t\t\t)\n\t\t)\n\n\t\t// x labels\n\t\tconst xLabels = DOMUtils.appendOrSelect(svg, 'g.x-labels').attr('role', Roles.GROUP)\n\t\tconst xLabelUpdate = xLabels.selectAll('text').data(this.uniqueKeys)\n\t\txLabelUpdate.join(\n\t\t\t(enter: any) =>\n\t\t\t\tenter\n\t\t\t\t\t.append('text')\n\t\t\t\t\t.text((key: any) => key)\n\t\t\t\t\t.attr('opacity', 0)\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'x',\n\t\t\t\t\t\t(key: any) =>\n\t\t\t\t\t\t\tpolarToCartesianCoords(xScale(key), yScale.range()[1] + xLabelPadding, c).x\n\t\t\t\t\t)\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'y',\n\t\t\t\t\t\t(key: any) =>\n\t\t\t\t\t\t\tpolarToCartesianCoords(xScale(key), yScale.range()[1] + xLabelPadding, c).y\n\t\t\t\t\t)\n\t\t\t\t\t.style('text-anchor', (key: any) => radialLabelPlacement(xScale(key)).textAnchor)\n\t\t\t\t\t.style(\n\t\t\t\t\t\t'dominant-baseline',\n\t\t\t\t\t\t(key: any) => radialLabelPlacement(xScale(key)).dominantBaseline\n\t\t\t\t\t)\n\t\t\t\t\t.call((selection: any) =>\n\t\t\t\t\t\tselection\n\t\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\t\tname: 'radar_x_labels_enter',\n\t\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.attr('opacity', 1)\n\t\t\t\t\t),\n\t\t\t(update: any) =>\n\t\t\t\tupdate.call((selection: any) =>\n\t\t\t\t\tselection\n\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\tname: 'radar_x_labels_update',\n\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.attr('opacity', 1)\n\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t'x',\n\t\t\t\t\t\t\t(key: any) =>\n\t\t\t\t\t\t\t\tpolarToCartesianCoords(xScale(key), yScale.range()[1] + xLabelPadding, c).x\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t'y',\n\t\t\t\t\t\t\t(key: any) =>\n\t\t\t\t\t\t\t\tpolarToCartesianCoords(xScale(key), yScale.range()[1] + xLabelPadding, c).y\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.end()\n\t\t\t\t\t\t.finally(() => {\n\t\t\t\t\t\t\t// Align chart horizontally after x-axies has finished rendering\n\t\t\t\t\t\t\tconst alignment = getProperty(options, 'radar', 'alignment')\n\n\t\t\t\t\t\t\tconst alignmentXOffset = this.getAlignmentXOffset(alignment, svg, this.getParent())\n\t\t\t\t\t\t\tsvg.attr('x', alignmentXOffset)\n\t\t\t\t\t\t})\n\t\t\t\t),\n\t\t\t(exit: any) =>\n\t\t\t\texit.call((selection: any) =>\n\t\t\t\t\tselection\n\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\tname: 'radar_x_labels_exit',\n\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.attr('opacity', 0)\n\t\t\t\t\t\t.remove()\n\t\t\t\t)\n\t\t)\n\n\t\t// blobs\n\t\tconst blobs = DOMUtils.appendOrSelect(svg, 'g.blobs').attr('role', Roles.GROUP)\n\t\tconst blobUpdate = blobs\n\t\t\t.selectAll('path')\n\t\t\t.data(this.groupedDataNormalized, (group: any) => group.name)\n\n\t\tblobUpdate.join(\n\t\t\t(enter: any) =>\n\t\t\t\tenter\n\t\t\t\t\t.append('path')\n\t\t\t\t\t.attr('class', (group: any) =>\n\t\t\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL, ColorClassNameTypes.STROKE],\n\t\t\t\t\t\t\tdataGroupName: group.name,\n\t\t\t\t\t\t\toriginalClassName: 'blob'\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t\t\t.attr('aria-label', (d: any) => d['name'])\n\t\t\t\t\t.attr('opacity', 0)\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'transform',\n\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t? () => `translate(${c.x}, ${c.y}) scale(${1 + Math.random() * 0.35})`\n\t\t\t\t\t\t\t: `translate(${c.x}, ${c.y})`\n\t\t\t\t\t)\n\t\t\t\t\t.style('fill', (group: any) => colorScale(group.name))\n\t\t\t\t\t.style('fill-opacity', radarConfigs.opacity.selected)\n\t\t\t\t\t.style('stroke', (group: any) => colorScale(group.name))\n\t\t\t\t\t.call((selection: any) => {\n\t\t\t\t\t\tconst selectionUpdate = selection.transition().call((t: any) =>\n\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\tname: 'radar_blobs_enter',\n\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\n\t\t\t\t\t\tif (animate) {\n\t\t\t\t\t\t\tselectionUpdate\n\t\t\t\t\t\t\t\t.delay(() => Math.random() * 30)\n\t\t\t\t\t\t\t\t.attr('transform', `translate(${c.x}, ${c.y})`)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tselectionUpdate\n\t\t\t\t\t\t\t.attr('opacity', 1)\n\t\t\t\t\t\t\t.attr('d', (group: any) => radialLineGenerator(group.data))\n\t\t\t\t\t}),\n\t\t\t(update: any) => {\n\t\t\t\tupdate\n\t\t\t\t\t.attr('class', (group: any) =>\n\t\t\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL, ColorClassNameTypes.STROKE],\n\t\t\t\t\t\t\tdataGroupName: group.name,\n\t\t\t\t\t\t\toriginalClassName: 'blob'\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.style('fill', (group: any) => colorScale(group.name))\n\t\t\t\t\t.style('stroke', (group: any) => colorScale(group.name))\n\t\t\t\tupdate.call((selection: any) =>\n\t\t\t\t\tselection\n\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\tname: 'radar_blobs_update',\n\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.attr('opacity', 1)\n\t\t\t\t\t\t.attr('transform', `translate(${c.x}, ${c.y})`)\n\t\t\t\t\t\t.attr('d', (group: any) => radialLineGenerator(group.data))\n\t\t\t\t)\n\t\t\t\treturn update\n\t\t\t},\n\t\t\t(exit: any) =>\n\t\t\t\texit.call((selection: any) => {\n\t\t\t\t\tconst selectionUpdate = selection.transition().call((t: any) =>\n\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\tname: 'radar_blobs_exit',\n\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\n\t\t\t\t\tif (animate) {\n\t\t\t\t\t\tselectionUpdate\n\t\t\t\t\t\t\t.delay(() => Math.random() * 30)\n\t\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t\t'transform',\n\t\t\t\t\t\t\t\t() => `translate(${c.x}, ${c.y}) scale(${1 + Math.random() * 0.35})`\n\t\t\t\t\t\t\t)\n\t\t\t\t\t}\n\n\t\t\t\t\tselectionUpdate.attr('opacity', 0).remove()\n\t\t\t\t})\n\t\t)\n\n\t\t// data dots\n\t\tconst dots = DOMUtils.appendOrSelect(svg, 'g.dots').attr('role', Roles.GROUP)\n\n\t\tconst dotsUpdate = dots\n\t\t\t.selectAll('circle')\n\t\t\t// Filter out dots with no value so they are not rendered\n\t\t\t.data(this.fullDataNormalized.filter((d: any) => getProperty(d, value) !== null))\n\n\t\tdotsUpdate\n\t\t\t.join(\n\t\t\t\t(enter: any) =>\n\t\t\t\t\tenter\n\t\t\t\t\t\t.append('circle')\n\t\t\t\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t\t\t\t.attr('aria-label', (d: any) => d[valueMapsTo]),\n\t\t\t\t(update: any) => update,\n\t\t\t\t(exit: any) => exit.remove()\n\t\t\t)\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\toriginalClassName: kebabCase(d[angle])\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('cx', (d: any) => polarToCartesianCoords(xScale(d[angle]), yScale(d[value]), c).x)\n\t\t\t.attr('cy', (d: any) => polarToCartesianCoords(xScale(d[angle]), yScale(d[value]), c).y)\n\t\t\t.attr('r', 0)\n\t\t\t.attr('opacity', 0)\n\t\t\t.style('fill', (d: any) => colorScale(d[groupMapsTo]))\n\n\t\t// rectangles\n\t\tconst xAxesRect = DOMUtils.appendOrSelect(svg, 'g.x-axes-rect').attr('role', Roles.GROUP)\n\t\tconst xAxisRectUpdate = xAxesRect.selectAll('rect').data(this.uniqueKeys)\n\t\txAxisRectUpdate\n\t\t\t.join(\n\t\t\t\t(enter: any) => enter.append('rect'),\n\t\t\t\t(update: any) => update,\n\t\t\t\t(exit: any) => exit.remove()\n\t\t\t)\n\t\t\t.attr('x', c.x)\n\t\t\t.attr('y', c.y - xAxisRectHeight / 2)\n\t\t\t.attr('width', yScale.range()[1])\n\t\t\t.attr('height', xAxisRectHeight)\n\t\t\t.style('fill', 'red')\n\t\t\t.style('fill-opacity', 0)\n\t\t\t.attr('transform', (key: any) => `rotate(${radToDeg(xScale(key))}, ${c.x}, ${c.y})`)\n\n\t\t// y labels (show only the min and the max labels)\n\t\tconst yLabels = DOMUtils.appendOrSelect(svg, 'g.y-labels').attr('role', Roles.GROUP)\n\t\tconst yLabelUpdate = yLabels.selectAll('text').data(extent(yTicks))\n\t\tyLabelUpdate.join(\n\t\t\t(enter: any) =>\n\t\t\t\tenter\n\t\t\t\t\t.append('text')\n\t\t\t\t\t.attr('opacity', 0)\n\t\t\t\t\t.text((tick: any) => tick)\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'x',\n\t\t\t\t\t\t(tick: any) => polarToCartesianCoords(-Math.PI / 2, yScale(tick), c).x + yLabelPadding\n\t\t\t\t\t)\n\t\t\t\t\t.attr('y', (tick: any) => polarToCartesianCoords(-Math.PI / 2, yScale(tick), c).y)\n\t\t\t\t\t.style('text-anchor', 'start')\n\t\t\t\t\t.style('dominant-baseline', 'middle')\n\t\t\t\t\t.call((selection: any) =>\n\t\t\t\t\t\tselection\n\t\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\t\tname: 'radar_y_labels_enter',\n\t\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.attr('opacity', 1)\n\t\t\t\t\t),\n\t\t\t(update: any) =>\n\t\t\t\tupdate.call((selection: any) =>\n\t\t\t\t\tselection\n\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\tname: 'radar_y_labels_update',\n\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.text((tick: any) => tick)\n\t\t\t\t\t\t.attr('opacity', 1)\n\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t'x',\n\t\t\t\t\t\t\t(tick: any) => polarToCartesianCoords(-Math.PI / 2, yScale(tick), c).x + yLabelPadding\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.attr('y', (tick: any) => polarToCartesianCoords(-Math.PI / 2, yScale(tick), c).y)\n\t\t\t\t),\n\t\t\t(exit: any) =>\n\t\t\t\texit.call((selection: any) =>\n\t\t\t\t\tselection\n\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\tname: 'radar_y_labels_exit',\n\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.attr('opacity', 0)\n\t\t\t\t\t\t.remove()\n\t\t\t\t)\n\t\t)\n\n\t\t// Add event listeners\n\t\tthis.addEventListeners()\n\t}\n\n\tgetAlignmentXOffset(alignment: any, svg: any, parent: any) {\n\t\tconst svgDimensions = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseBBox: true\n\t\t})\n\t\tconst { width } = DOMUtils.getSVGElementSize(parent, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tlet alignmentOffset = 0\n\t\tif (alignment === Alignments.CENTER) {\n\t\t\talignmentOffset = Math.floor((width - svgDimensions.width) / 2)\n\t\t} else if (alignment === Alignments.RIGHT) {\n\t\t\talignmentOffset = width - svgDimensions.width\n\t\t}\n\n\t\treturn alignmentOffset\n\t}\n\n\t// append temporarily the label to get the exact space that it occupies\n\tgetLabelDimensions = (label: string) => {\n\t\tconst tmpTick = DOMUtils.appendOrSelect(this.getComponentContainer(), `g.tmp-tick`)\n\t\tconst tmpTickText = DOMUtils.appendOrSelect(tmpTick, `text`).text(label)\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(tmpTickText.node(), { useBBox: true })\n\t\ttmpTick.remove()\n\t\treturn { width, height }\n\t}\n\n\t// Given a flat array of objects, if there are missing data on key,\n\t// creates corresponding data with value = null\n\tnormalizeFlatData = (dataset: any) => {\n\t\tconst options = this.getOptions()\n\t\tconst { angle, value } = getProperty(options, 'radar', 'axes')\n\t\tconst groupMapsTo = getProperty(options, 'data', 'groupMapsTo')\n\t\tconst completeBlankData = flatMapDeep(\n\t\t\tthis.uniqueKeys.map((key: any) => {\n\t\t\t\treturn this.uniqueGroups.map(group => ({\n\t\t\t\t\t[angle]: key,\n\t\t\t\t\t[groupMapsTo]: group,\n\t\t\t\t\t[value]: null\n\t\t\t\t}))\n\t\t\t})\n\t\t)\n\t\treturn merge(completeBlankData, dataset)\n\t}\n\n\t// Given a a grouped array of objects, if there are missing data on key,\n\t// creates corresponding data with value = null\n\tnormalizeGroupedData = (dataset: any) => {\n\t\tconst options = this.getOptions()\n\t\tconst { angle, value } = getProperty(options, 'radar', 'axes')\n\t\tconst groupMapsTo = getProperty(options, 'data', 'groupMapsTo')\n\t\treturn dataset.map(({ name, data }: { name: any; data: any }) => {\n\t\t\tconst completeBlankData = this.uniqueKeys.map((k: any) => ({\n\t\t\t\t[groupMapsTo]: name,\n\t\t\t\t[angle]: k,\n\t\t\t\t[value]: null\n\t\t\t}))\n\t\t\treturn { name, data: merge(completeBlankData, data) }\n\t\t})\n\t}\n\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\t\tthis.parent\n\t\t\t.selectAll('g.blobs path')\n\t\t\t.transition('legend-hover-blob')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-blob'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('fill-opacity', (group: any) => {\n\t\t\t\tif (group.name !== hoveredElement.datum().name) {\n\t\t\t\t\treturn radarConfigs.opacity.unselected\n\t\t\t\t}\n\t\t\t\treturn radarConfigs.opacity.selected\n\t\t\t})\n\t\t\t.style('stroke-opacity', (group: any) => {\n\t\t\t\tif (group.name !== hoveredElement.datum().name) {\n\t\t\t\t\treturn radarConfigs.opacity.unselected\n\t\t\t\t}\n\t\t\t\treturn 1\n\t\t\t})\n\t}\n\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('g.blobs path')\n\t\t\t.transition('legend-mouseout-blob')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-blob'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('fill-opacity', radarConfigs.opacity.selected)\n\t\t\t.style('stroke-opacity', 1)\n\t}\n\n\tdestroy() {\n\t\t// Remove event listeners\n\t\tthis.parent\n\t\t\t.selectAll('.x-axes-rect > rect')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('mouseout', null)\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this\n\t\tconst {\n\t\t\taxes: { angle }\n\t\t} = getProperty(this.getOptions(), 'radar')\n\n\t\t// events on x axes rects\n\t\tthis.parent\n\t\t\t.selectAll('.x-axes-rect > rect')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Radar.X_AXIS_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tconst axisLine = self.parent.select(`.x-axes .x-axis-${kebabCase(datum)}`)\n\t\t\t\tconst dots = self.parent.selectAll(`.dots circle.${kebabCase(datum)}`)\n\n\t\t\t\tconst activeDataGroupNames = self.model.getActiveDataGroupNames()\n\n\t\t\t\tconst options = self.getOptions()\n\t\t\t\tconst { groupMapsTo } = options.data\n\t\t\t\tconst valueMapsTo = getProperty(options, 'radar', 'axes', 'value')\n\n\t\t\t\t// Change style\n\t\t\t\taxisLine.classed('hovered', true).attr('stroke-dasharray', '4 4')\n\t\t\t\tdots\n\t\t\t\t\t.classed('hovered', true)\n\t\t\t\t\t.attr('opacity', (d: any) =>\n\t\t\t\t\t\tactiveDataGroupNames.indexOf(d[groupMapsTo]) !== -1 ? 1 : 0\n\t\t\t\t\t)\n\t\t\t\t\t.attr('r', radarConfigs.dotsRadius)\n\n\t\t\t\t// get the items that should be highlighted\n\t\t\t\tconst itemsToHighlight = self.fullDataNormalized.filter(\n\t\t\t\t\t(d: any) => d[angle] === datum && activeDataGroupNames.indexOf(d[groupMapsTo]) !== -1\n\t\t\t\t)\n\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: itemsToHighlight\n\t\t\t\t\t\t.filter((d: any) => typeof d[valueMapsTo] === 'number')\n\t\t\t\t\t\t.map((d: any) => ({\n\t\t\t\t\t\t\tlabel: d[groupMapsTo],\n\t\t\t\t\t\t\tvalue: d[valueMapsTo],\n\t\t\t\t\t\t\tcolor: self.model.getFillColor(d[groupMapsTo]),\n\t\t\t\t\t\t\tclass: self.model.getColorClassName({\n\t\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.TOOLTIP],\n\t\t\t\t\t\t\t\tdataGroupName: d[groupMapsTo]\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}))\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Radar.X_AXIS_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Radar.X_AXIS_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\tconst axisLine = self.parent.select(`.x-axes .x-axis-${kebabCase(datum)}`)\n\t\t\t\tconst dots = self.parent.selectAll(`.dots circle.${kebabCase(datum)}`)\n\n\t\t\t\t// Change style\n\t\t\t\taxisLine.classed('hovered', false).attr('stroke-dasharray', '0')\n\n\t\t\t\tdots.classed('hovered', false).attr('opacity', 0).attr('r', 0)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Radar.X_AXIS_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE)\n\t\t\t})\n\t}\n}\n","import { select } from 'd3'\nimport { generateSVGPathString } from '@/tools'\nimport { Bar } from './bar'\nimport { Events, RenderTypes, ColorClassNameTypes, CartesianOrientations } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\n\nexport class SimpleBar extends Bar {\n\ttype = 'simple-bar'\n\trenderType = RenderTypes.SVG\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events\n\n\t\t// Highlight correct circle on legend item hovers\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\n\t\t// Un-highlight circles on legend item mouseouts\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate: boolean) {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true })\n\n\t\tconst data = this.model.getDisplayData(this.configs.groups)\n\n\t\tconst orientation = this.services.cartesianScales.getOrientation()\n\n\t\t// Update data on all bars\n\t\tconst bars = svg.selectAll('path.bar').data(data, (datum: any) => datum[groupMapsTo])\n\n\t\t// Remove bars that are no longer needed\n\t\tbars.exit().attr('opacity', 0).remove()\n\n\t\t// Add the paths that need to be introduced\n\t\tconst barsEnter = bars.enter().append('path').attr('opacity', 0)\n\n\t\tbarsEnter\n\t\t\t.merge(bars as any)\n\t\t\t.classed('bar', true)\n\t\t\t.attr('width', this.getBarWidth.bind(this))\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'bar-update-enter',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\toriginalClassName: 'bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('fill', (d: any) => this.model.getFillColor(d[groupMapsTo]))\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\t/*\n\t\t\t\t * Orientation support for horizontal/vertical bar charts\n\t\t\t\t * Determine coordinates needed for a vertical set of paths\n\t\t\t\t * to draw the bars needed, and pass those coordinates down to\n\t\t\t\t * generateSVGPathString() to decide whether it needs to flip them\n\t\t\t\t */\n\t\t\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier()\n\t\t\t\tconst barWidth = this.getBarWidth()\n\t\t\t\tconst value = d[rangeIdentifier]\n\n\t\t\t\tconst x0 = this.services.cartesianScales.getDomainValue(d) - barWidth / 2\n\t\t\t\tconst x1 = x0 + barWidth\n\t\t\t\tlet y0: number, y1: number\n\t\t\t\tif (Array.isArray(value) && value.length === 2) {\n\t\t\t\t\ty0 = this.services.cartesianScales.getRangeValue(value[0])\n\t\t\t\t\ty1 = this.services.cartesianScales.getRangeValue(value[1])\n\t\t\t\t} else {\n\t\t\t\t\tconst rangeScale = this.services.cartesianScales.getRangeScale()\n\t\t\t\t\tconst yScaleDomainStart = rangeScale.domain()[0] as number\n\n\t\t\t\t\ty0 = this.services.cartesianScales.getRangeValue(Math.max(0, yScaleDomainStart))\n\t\t\t\t\ty1 = this.services.cartesianScales.getRangeValue(d)\n\t\t\t\t}\n\n\t\t\t\tconst difference = Math.abs(y1 - y0)\n\t\t\t\t// Set a min-2px size for the bar\n\t\t\t\tif (difference !== 0 && difference < 2) {\n\t\t\t\t\tif (\n\t\t\t\t\t\t(value > 0 && orientation === CartesianOrientations.VERTICAL) ||\n\t\t\t\t\t\t(value < 0 && orientation === CartesianOrientations.HORIZONTAL)\n\t\t\t\t\t) {\n\t\t\t\t\t\ty1 = y0 - 2\n\t\t\t\t\t} else {\n\t\t\t\t\t\ty1 = y0 + 2\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// don't show if part of bar is out of zoom domain\n\t\t\t\tif (this.isOutsideZoomedDomain(x0, x1)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\treturn generateSVGPathString({ x0, x1, y0, y1 }, orientation)\n\t\t\t})\n\t\t\t.attr('opacity', 1)\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'bar')\n\t\t\t.attr('aria-label', (d: any) => d.value)\n\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners()\n\t}\n\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\t\tconst { groupMapsTo } = this.getOptions().data\n\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.transition('legend-hover-simple-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-simple-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => (d[groupMapsTo] !== hoveredElement.datum()['name'] ? 0.3 : 1))\n\t}\n\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.transition('legend-mouseout-simple-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-simple-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', true)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\tdata: [datum]\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', false)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\tdestroy() {\n\t\t// Remove event listeners\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('mouseout', null)\n\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n}\n","import type { ScaleLinear, Selection } from 'd3'\nimport { getProperty } from '@/tools'\nimport { Skeleton } from './skeleton'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\n\nexport class SkeletonLines extends Skeleton {\n\ttype = 'skeleton-lines'\n\txScale: ScaleLinear<number, number>\n\tyScale: ScaleLinear<number, number>\n\tbackdrop: Selection<SVGElement | HTMLDivElement, unknown, Element, any>\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\tconst isDataLoading = getProperty(this.getOptions(), 'data', 'loading')\n\n\t\tconst isSparkline =\n\t\t\t!getProperty(this.getOptions(), 'grid', 'x', 'enabled') &&\n\t\t\t!getProperty(this.getOptions(), 'grid', 'y', 'enabled') &&\n\t\t\t!getProperty(this.getOptions(), 'axes', 'bottom', 'visible') &&\n\t\t\t!getProperty(this.getOptions(), 'axes', 'left', 'visible')\n\n\t\t// display a skeleton if there is no chart data or the loading flag is set to true\n\t\tif (isDataLoading && !isSparkline) {\n\t\t\tsuper.renderGridSkeleton(isDataLoading)\n\t\t} else if (isDataLoading && isSparkline) {\n\t\t\tthis.renderSparklineSkeleton(isDataLoading)\n\t\t} else {\n\t\t\tthis.removeSkeleton()\n\t\t}\n\t}\n\n\trenderSparklineSkeleton(showShimmerEffect: boolean) {\n\t\tthis.setScales()\n\t\tthis.drawBackdrop(showShimmerEffect)\n\t\tthis.drawSparkline(showShimmerEffect)\n\t\tthis.updateBackdropStyle()\n\t\tif (showShimmerEffect) {\n\t\t\tthis.setShimmerEffect('shimmer-lines')\n\t\t}\n\t}\n\n\tdrawSparkline(showShimmerEffect: boolean) {\n\t\tconst width = this.backdrop.attr('width')\n\t\tconst ticksValues = [100]\n\t\tconst sparklineSkeleton = DOMUtils.appendOrSelect(this.backdrop, 'g.y.skeleton')\n\t\tconst update = sparklineSkeleton.selectAll('line').data(ticksValues)\n\t\tupdate\n\t\t\t.enter()\n\t\t\t.append('line')\n\t\t\t.merge(update as any)\n\t\t\t.attr('x1', 0)\n\t\t\t.attr('x2', width)\n\t\t\t.attr('y1', (d: any) => d)\n\t\t\t.attr('y2', (d: any) => d)\n\n\t\tsparklineSkeleton\n\t\t\t.selectAll('line')\n\t\t\t.classed('shimmer-effect-lines', showShimmerEffect)\n\t\t\t.classed('empty-state-lines', !showShimmerEffect)\n\t\t\t.style(\n\t\t\t\t'stroke',\n\t\t\t\tshowShimmerEffect\n\t\t\t\t\t? `url(#${this.services.domUtils.generateElementIDString(`shimmer-lines`)})`\n\t\t\t\t\t: null\n\t\t\t)\n\t}\n\n\tupdateBackdropStyle() {\n\t\tconst svg = this.parent\n\n\t\tthis.backdrop = DOMUtils.appendOrSelect(svg, 'svg.chart-skeleton.DAII')\n\t\tconst backdropRect = DOMUtils.appendOrSelect(this.backdrop, 'rect.chart-skeleton-backdrop')\n\n\t\tbackdropRect\n\t\t\t.classed('shimmer-effect-lines', false)\n\t\t\t.classed('shimmer-effect-sparkline', true)\n\t\t\t.style('stroke', null)\n\t}\n}\n","import { area } from 'd3'\nimport { getProperty } from '@/tools'\nimport { area as areaConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport { Events, ColorClassNameTypes, RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\n\nexport class StackedArea extends Component {\n\ttype = 'area-stacked'\n\trenderType = RenderTypes.SVG\n\n\tareaGenerator: any\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events\n\n\t\t// Highlight correct area on legend item hovers\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\n\t\t// Un-highlight area on legend item mouseouts\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true })\n\t\tconst self = this\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst percentage = Object.keys(options.axes).some(axis => options.axes[axis].percentage)\n\n\t\tconst stackedData = this.model.getStackedData({\n\t\t\tpercentage,\n\t\t\tgroups: this.configs.groups\n\t\t})\n\n\t\tconst datum = getProperty(stackedData, 0, 0) as number[] // firstDatum name could not be used by getDomainAxisPosition() and getRangeAxisPosition() below\n\n\t\t// area doesn't have to use the main range and domain axes - they can be mapped to the secondary (in the case of a combo chart)\n\t\t// however area _cannot_ have multiple datasets that are mapped to _different_ ranges and domains so we can use the first data item\n\t\tconst domainAxisPosition = this.services.cartesianScales.getDomainAxisPosition({ datum })\n\t\tconst rangeAxisPosition = this.services.cartesianScales.getRangeAxisPosition({ datum })\n\t\tconst mainYScale = this.services.cartesianScales.getScaleByPosition(rangeAxisPosition)\n\n\t\tconst areas = svg\n\t\t\t.selectAll('path.area')\n\t\t\t.data(stackedData, (d: any) => getProperty(d, 0, groupMapsTo))\n\n\t\t// D3 area generator function\n\t\tthis.areaGenerator = area()\n\t\t\t.x((d: any) =>\n\t\t\t\tthis.services.cartesianScales.getValueThroughAxisPosition(\n\t\t\t\t\tdomainAxisPosition,\n\t\t\t\t\td.data.sharedStackKey\n\t\t\t\t)\n\t\t\t)\n\t\t\t.y0((d: any) => mainYScale(d[0]))\n\t\t\t.y1((d: any) => mainYScale(d[1]))\n\t\t\t.curve(this.services.curves.getD3Curve())\n\n\t\tareas.exit().attr('opacity', 0).remove()\n\n\t\tconst enteringAreas = areas.enter().append('path').attr('opacity', 0)\n\n\t\tenteringAreas\n\t\t\t.merge(areas as any)\n\t\t\t.data(stackedData, (d: any) => getProperty(d, 0, groupMapsTo))\n\t\t\t.attr('class', 'area')\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: getProperty(d, 0, groupMapsTo),\n\t\t\t\t\toriginalClassName: 'area'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('fill', (d: any) => self.model.getFillColor(getProperty(d, 0, groupMapsTo)))\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'area')\n\t\t\t.attr('aria-label', (d: any) => getProperty(d, 0, groupMapsTo))\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'area-update-enter',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', areaConfigs.opacity.selected)\n\t\t\t.attr('d', this.areaGenerator)\n\t}\n\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tthis.parent\n\t\t\t.selectAll('path.area')\n\t\t\t.transition('legend-hover-area')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-area'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => {\n\t\t\t\tif (getProperty(d, 0, groupMapsTo) !== hoveredElement.datum().name) {\n\t\t\t\t\treturn areaConfigs.opacity.unselected\n\t\t\t\t}\n\n\t\t\t\treturn areaConfigs.opacity.selected\n\t\t\t})\n\t}\n\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('path.area')\n\t\t\t.transition('legend-mouseout-area')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-area'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', areaConfigs.opacity.selected)\n\t}\n}\n","import { select } from 'd3'\nimport { generateSVGPathString, getProperty } from '@/tools'\nimport { Bar } from './bar'\nimport { Events, CartesianOrientations, ColorClassNameTypes, RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\n\nexport class StackedBar extends Bar {\n\ttype = 'stacked-bar'\n\trenderType = RenderTypes.SVG\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events\n\n\t\t// Highlight correct circle on legend item hovers\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\n\t\t// Un-highlight circles on legend item mouseouts\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate: boolean) {\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true })\n\n\t\t// Chart options mixed with the internal configurations\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\t// Create the data and keys that'll be used by the stack layout\n\t\tconst stackData = this.model.getStackedData({\n\t\t\tgroups: this.configs.groups,\n\t\t\tdivergent: true\n\t\t})\n\n\t\tconst activeDataGroupNames = this.model.getActiveDataGroupNames()\n\n\t\t// Update data on all bar groups\n\t\tconst barGroups = svg\n\t\t\t.selectAll('g.bars')\n\t\t\t.data(stackData, (d: any) => getProperty(d, 0, groupMapsTo))\n\n\t\t// Remove elements that need to be exited\n\t\t// We need exit at the top here to make sure that\n\t\t// Data filters are processed before entering new elements\n\t\t// Or updating existing ones\n\t\tbarGroups.exit().attr('opacity', 0).remove()\n\n\t\t// Add bar groups that need to be introduced\n\t\tbarGroups\n\t\t\t.enter()\n\t\t\t.append('g')\n\t\t\t.classed('bars', true)\n\t\t\t.attr('role', Roles.GROUP)\n\t\t\t.attr('data-name', 'bars')\n\n\t\t// Update data on all bars\n\t\tconst bars = svg\n\t\t\t.selectAll('g.bars')\n\t\t\t.selectAll('path.bar')\n\t\t\t.data(\n\t\t\t\t(d: any) => d,\n\t\t\t\t(d: any) => d.data.sharedStackKey\n\t\t\t)\n\n\t\t// Remove bars that need to be removed\n\t\tbars.exit().remove()\n\n\t\tbars\n\t\t\t.enter()\n\t\t\t.append('path')\n\t\t\t.merge(bars as any)\n\t\t\t.classed('bar', true)\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'bar-update-enter',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\toriginalClassName: 'bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('fill', (d: any) => this.model.getFillColor(d[groupMapsTo]))\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\tconst key = d.data.sharedStackKey as string\n\n\t\t\t\t/*\n\t\t\t\t * Orientation support for horizontal/vertical bar charts\n\t\t\t\t * Determine coordinates needed for a vertical set of paths\n\t\t\t\t * to draw the bars needed, and pass those coordinates down to\n\t\t\t\t * generateSVGPathString() to decide whether it needs to flip them\n\t\t\t\t */\n\t\t\t\tconst barWidth = this.getBarWidth()\n\t\t\t\tconst x0 = this.services.cartesianScales.getDomainValue(key) - barWidth / 2\n\t\t\t\tconst x1 = x0 + barWidth\n\t\t\t\tconst y0 = this.services.cartesianScales.getRangeValue(d[0])\n\t\t\t\tlet y1 = this.services.cartesianScales.getRangeValue(d[1])\n\n\t\t\t\t// don't show if part of bar is out of zoom domain\n\t\t\t\tif (this.isOutsideZoomedDomain(x0, x1)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// Add the divider gap\n\t\t\t\tif (Math.abs(y1 - y0) > 0 && Math.abs(y1 - y0) > options.bars.dividerSize) {\n\t\t\t\t\tconst barIsNegative = d[0] < 0 && d[1] <= 0\n\t\t\t\t\tif (barIsNegative && activeDataGroupNames.length > 1) {\n\t\t\t\t\t\tif (this.services.cartesianScales.getOrientation() === CartesianOrientations.VERTICAL) {\n\t\t\t\t\t\t\ty1 += d[1] === 0 ? 2 : 1\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ty1 -= 1\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (!barIsNegative) {\n\t\t\t\t\t\tif (this.services.cartesianScales.getOrientation() === CartesianOrientations.VERTICAL) {\n\t\t\t\t\t\t\ty1 += 1\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ty1 -= 1\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn generateSVGPathString(\n\t\t\t\t\t{ x0, x1, y0, y1 },\n\t\t\t\t\tthis.services.cartesianScales.getOrientation()\n\t\t\t\t)\n\t\t\t})\n\t\t\t.attr('opacity', 1)\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'bar')\n\t\t\t.attr('aria-label', (d: any) => d[1] - d[0])\n\n\t\t// Add event listeners for the above elements\n\t\tthis.addEventListeners()\n\t}\n\n\t// Highlight elements that match the hovered legend item\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\n\t\tconst { groupMapsTo } = this.model.getOptions().data\n\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.transition('legend-hover-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => (d[groupMapsTo] !== hoveredElement.datum()['name'] ? 0.3 : 1))\n\t}\n\n\t// Un-highlight all elements\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.transition('legend-mouseout-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\taddEventListeners() {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst self = this\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', true)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tconst displayData = self.model.getDisplayData(self.configs.groups)\n\n\t\t\t\tlet matchingDataPoint = displayData.find((d: any) => {\n\t\t\t\t\tconst domainIdentifier = self.services.cartesianScales.getDomainIdentifier(d)\n\t\t\t\t\tconst rangeIdentifier = self.services.cartesianScales.getRangeIdentifier(d)\n\t\t\t\t\treturn (\n\t\t\t\t\t\td[rangeIdentifier] === datum.data[datum[groupMapsTo]] &&\n\t\t\t\t\t\td[domainIdentifier].toString() === datum.data.sharedStackKey &&\n\t\t\t\t\t\td[groupMapsTo] === datum[groupMapsTo]\n\t\t\t\t\t)\n\t\t\t\t})\n\n\t\t\t\tif (matchingDataPoint === undefined) {\n\t\t\t\t\t// use the primary range and domain ids\n\t\t\t\t\tconst domainIdentifier = self.services.cartesianScales.getDomainIdentifier()\n\t\t\t\t\tconst rangeIdentifier = self.services.cartesianScales.getRangeIdentifier()\n\t\t\t\t\tmatchingDataPoint = {\n\t\t\t\t\t\t[domainIdentifier]: datum.data.sharedStackKey,\n\t\t\t\t\t\t[rangeIdentifier]: datum.data[datum[groupMapsTo]],\n\t\t\t\t\t\t[groupMapsTo]: datum[groupMapsTo]\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\tdata: [matchingDataPoint]\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', false)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\tprotected getBarWidth() {\n\t\tconst options = this.getOptions()\n\t\tif (getProperty(options, 'bars', 'width')) {\n\t\t\treturn options.bars.width as number\n\t\t}\n\t\tconst mainXScale = this.services.cartesianScales.getMainXScale()\n\t\tconst chartWidth = DOMUtils.getSVGElementSize((this as any).parent, {\n\t\t\tuseAttrs: true\n\t\t}).width\n\n\t\tconst numberOfDomainValues = this.model.getStackKeys().length\n\n\t\tconst spacingFactor = getProperty(options, 'bars', 'spacingFactor')\n\n\t\tif (!(mainXScale as any).step) {\n\t\t\treturn Math.min(options.bars.maxWidth, (chartWidth * spacingFactor) / numberOfDomainValues)\n\t\t}\n\t\treturn Math.min(options.bars.maxWidth, (mainXScale as any).step() / 2)\n\t}\n\n\tdestroy() {\n\t\t// Remove event listeners\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('mouseout', null)\n\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n}\n","import { getProperty } from '@/tools'\nimport { Scatter } from './scatter'\nimport { RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\n\nexport class StackedScatter extends Scatter {\n\ttype = 'scatter-stacked'\n\trenderType = RenderTypes.SVG\n\n\trender(animate: boolean) {\n\t\tconst isScatterEnabled = getProperty(this.getOptions(), 'points', 'enabled')\n\t\tif (!isScatterEnabled) {\n\t\t\treturn\n\t\t}\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true })\n\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst percentage = Object.keys(options.axes).some(axis => options.axes[axis].percentage)\n\t\tconst stackedData = this.model.getStackedData({\n\t\t\tgroups: this.configs.groups,\n\t\t\tpercentage\n\t\t})\n\n\t\t// Update data on dot groups\n\t\tconst circleGroups = svg\n\t\t\t.selectAll('g.dots')\n\t\t\t.data(stackedData, (d: any) => getProperty(d, 0, groupMapsTo))\n\n\t\t// Remove dot groups that need to be removed\n\t\tcircleGroups.exit().attr('opacity', 0).remove()\n\n\t\t// Add the dot groups that need to be introduced\n\t\tconst circleGroupsEnter = circleGroups\n\t\t\t.enter()\n\t\t\t.append('g')\n\t\t\t.classed('dots', true)\n\t\t\t.attr('role', Roles.GROUP)\n\n\t\t// Update data on all circles\n\t\tconst circles = circleGroupsEnter\n\t\t\t.merge(circleGroups as any)\n\t\t\t.selectAll('circle.dot')\n\t\t\t.data((d: any) => d)\n\n\t\t// Remove circles that need to be removed\n\t\tcircles.exit().attr('opacity', 0).remove()\n\n\t\t// Add the dot groups that need to be introduced\n\t\tconst enteringCircles = circles.enter().append('circle').classed('dot', true).attr('opacity', 0)\n\n\t\t// Apply styling & position\n\t\tconst circlesToStyle = enteringCircles.merge(circles as any).datum((d: any) => {\n\t\t\tconst group = d[groupMapsTo]\n\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(d)\n\t\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier(d)\n\n\t\t\treturn {\n\t\t\t\t[groupMapsTo]: group,\n\t\t\t\t[domainIdentifier]: d['data']['sharedStackKey'],\n\t\t\t\t[rangeIdentifier]: d[1]\n\t\t\t}\n\t\t})\n\t\tthis.styleCircles(circlesToStyle, animate)\n\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners()\n\t}\n\n\tgetTooltipData(hoveredX: number, hoveredY: number) {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst percentage = Object.keys(options.axes).some(axis => options.axes[axis].percentage)\n\t\tconst stackedData = this.model.getStackedData({\n\t\t\tgroups: this.configs.groups,\n\t\t\tpercentage\n\t\t})\n\t\tconst tooltipData: any[] = []\n\t\tstackedData.forEach((groupData: any, groupDataIndex: any) => {\n\t\t\tgroupData.forEach((datum: any, dataIndex: number) => {\n\t\t\t\tconst group = datum[groupMapsTo]\n\t\t\t\tconst domainValue = datum['data']['sharedStackKey']\n\t\t\t\tlet rangeValue = datum['data'][group]\n\t\t\t\tconst stackedRangeValue = datum[1]\n\t\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(datum)\n\t\t\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier(datum)\n\n\t\t\t\tif (\n\t\t\t\t\trangeValue !== null &&\n\t\t\t\t\trangeValue !== undefined &&\n\t\t\t\t\thoveredX === this.services.cartesianScales.getDomainValue(domainValue) &&\n\t\t\t\t\thoveredY === this.services.cartesianScales.getRangeValue(stackedRangeValue)\n\t\t\t\t) {\n\t\t\t\t\tif (percentage) {\n\t\t\t\t\t\trangeValue = this.model.getStackedData({\n\t\t\t\t\t\t\tgroups: this.configs.groups\n\t\t\t\t\t\t})[groupDataIndex][dataIndex]['data'][group]\n\t\t\t\t\t}\n\n\t\t\t\t\tif (rangeValue !== null) {\n\t\t\t\t\t\ttooltipData.push({\n\t\t\t\t\t\t\t[groupMapsTo]: group,\n\t\t\t\t\t\t\t[domainIdentifier]: domainValue,\n\t\t\t\t\t\t\t[rangeIdentifier]: rangeValue\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\n\t\treturn this.model.getDisplayData(this.configs.groups).filter((datapoint: any) => {\n\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(datapoint)\n\t\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier(datapoint)\n\t\t\treturn (\n\t\t\t\ttooltipData.find(tooltipDatapoint => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\ttooltipDatapoint[groupMapsTo] == datapoint[groupMapsTo] &&\n\t\t\t\t\t\ttooltipDatapoint[domainIdentifier] == datapoint[domainIdentifier] &&\n\t\t\t\t\t\ttooltipDatapoint[rangeIdentifier] == datapoint[rangeIdentifier]\n\t\t\t\t\t)\n\t\t\t\t}) !== undefined\n\t\t\t)\n\t\t})\n\t}\n}\n","import { cluster as d3Cluster, tree as d3Tree, hierarchy, linkHorizontal, select } from 'd3'\nimport { getProperty } from '@/tools'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { Events, RenderTypes, TreeTypes } from '@/interfaces/enums'\nimport type { Coordinates } from '@/interfaces/layout'\n\nconst NODE_OFFSET = 6\n\nexport class Tree extends Component {\n\ttype = 'tree'\n\trenderType = RenderTypes.SVG\n\n\tgetLongestLabel(data: any) {\n\t\tlet longestLabel = ''\n\t\tdata.forEach((d: any) => {\n\t\t\tconst longestLabelInChildren = d.children ? this.getLongestLabel(d.children) : ''\n\t\t\tif (\n\t\t\t\tlongestLabelInChildren.length > longestLabel.length ||\n\t\t\t\td.name.length > longestLabel.length\n\t\t\t) {\n\t\t\t\tlongestLabel =\n\t\t\t\t\tlongestLabelInChildren.length > d.name.length ? longestLabelInChildren : d.name\n\t\t\t}\n\t\t})\n\n\t\treturn longestLabel\n\t}\n\n\tgetMockLabelWidth(svg: any, label: string) {\n\t\t// Add mock label to get dimensions\n\t\tconst mockLabel = svg\n\t\t\t.append('text')\n\t\t\t.attr('dy', '0.31em')\n\t\t\t.attr('x', 0)\n\t\t\t.attr('text-anchor', 'end')\n\t\t\t.text(label)\n\n\t\t// Get the mock label width\n\t\tconst { width: mockLabelWidth } = DOMUtils.getSVGElementSize(mockLabel.node(), {\n\t\t\tuseBBox: true\n\t\t})\n\n\t\t// Remove the mock title label\n\t\tmockLabel.remove()\n\n\t\treturn mockLabelWidth\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer()\n\n\t\t// Empty out the svg before rendering the tree\n\t\tsvg.html('')\n\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(this.parent as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tif (width < 1 || height < 1) {\n\t\t\treturn\n\t\t}\n\n\t\tconst options = this.model.getOptions()\n\t\tconst displayData = this.model.getDisplayData()\n\n\t\tconst rootTitle = getProperty(options, 'tree', 'rootTitle') || 'Tree'\n\n\t\tconst mockRootTitleWidth = this.getMockLabelWidth(svg, rootTitle)\n\n\t\tconst longestLabel = this.getLongestLabel(displayData)\n\t\tconst mockLongestLabelWidth = this.getMockLabelWidth(svg, longestLabel)\n\n\t\tconst margin = {\n\t\t\ttop: 0,\n\t\t\tright: 0,\n\t\t\tbottom: 0,\n\t\t\tleft: mockRootTitleWidth > 0 ? mockRootTitleWidth + NODE_OFFSET : 30 - NODE_OFFSET\n\t\t}\n\t\tconst root = hierarchy({\n\t\t\tname: rootTitle,\n\t\t\tchildren: displayData\n\t\t}) as any\n\n\t\tconst dx = 10\n\t\tconst dy = width / 6\n\n\t\tconst update = (source: Coordinates) => {\n\t\t\tconst nodes = root.descendants().reverse()\n\t\t\tconst links = root.links()\n\n\t\t\tlet left = root\n\t\t\tlet right = root\n\t\t\troot.eachBefore((node: Coordinates) => {\n\t\t\t\tif (node.x < left.x) left = node\n\t\t\t\tif (node.x > right.x) right = node\n\t\t\t})\n\n\t\t\tconst updateHeight = right.x - left.x\n\n\t\t\tconst transition = svg\n\t\t\t\t.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'tree-update-viewbox',\n\t\t\t\t\t\tanimate: true\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.attr('viewBox', [-margin.left, left.x, width, updateHeight].join(' ')) // viewBox expects a delimited string\n\n\t\t\t// Update data on nodes\n\t\t\tconst nodeGroups = nodeGroup.selectAll('g').data(nodes, (d: any) => d.id)\n\n\t\t\tconst self = this\n\t\t\t// Add any entering nodes\n\t\t\tconst nodeGroupsEnter = nodeGroups\n\t\t\t\t.enter()\n\t\t\t\t.append('g')\n\t\t\t\t.attr('transform', () => `translate(${source.y0},${source.x0})`)\n\t\t\t\t.attr('class', (d: any) =>\n\t\t\t\t\td.depth !== 0 && d.children && d.children.length > 0 ? 'clickable' : null\n\t\t\t\t)\n\t\t\t\t.on('mouseover', function (event: MouseEvent, d: any) {\n\t\t\t\t\t// Dispatch mouse event\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tree.NODE_MOUSEOVER, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\telement: select(this),\n\t\t\t\t\t\tdatum: d\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t\t.on('click', function (event: MouseEvent, d: any) {\n\t\t\t\t\tif (d.depth !== 0) {\n\t\t\t\t\t\td.children = d.children ? null : d._children\n\n\t\t\t\t\t\tupdate(d)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Dispatch mouse event\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tree.NODE_CLICK, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\telement: select(this),\n\t\t\t\t\t\tdatum: d\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t\t.on('mouseout', function (event: MouseEvent, d: any) {\n\t\t\t\t\t// Dispatch mouse event\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tree.NODE_MOUSEOUT, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\telement: select(this),\n\t\t\t\t\t\tdatum: d\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t// Add node circles to entering nodes\n\t\t\tnodeGroupsEnter\n\t\t\t\t.append('circle')\n\t\t\t\t.attr('r', 2.5)\n\t\t\t\t.attr('class', (d: any) => (d._children ? 'parent' : 'child'))\n\t\t\t\t.attr('stroke-width', 10)\n\n\t\t\t// Add node labels\n\t\t\tnodeGroupsEnter\n\t\t\t\t.append('text')\n\t\t\t\t.attr('dy', '0.31em')\n\t\t\t\t.attr('x', (d: any) => (d._children ? -NODE_OFFSET : NODE_OFFSET))\n\t\t\t\t.attr('text-anchor', (d: any) => (d._children ? 'end' : 'start'))\n\t\t\t\t.text((d: any) => d.data.name)\n\t\t\t\t.clone(true)\n\t\t\t\t.attr('class', 'text-stroke')\n\t\t\t\t.lower()\n\n\t\t\t// Reposition nodes\n\t\t\tnodeGroups\n\t\t\t\t.merge(nodeGroupsEnter)\n\t\t\t\t.transition(transition)\n\t\t\t\t.attr('transform', (d: Coordinates) => `translate(${d.y},${d.x})`)\n\t\t\t\t.attr('fill-opacity', 1)\n\t\t\t\t.attr('stroke-opacity', 1)\n\n\t\t\t// Remove exiting nodes\n\t\t\tnodeGroups\n\t\t\t\t.exit()\n\t\t\t\t.transition(transition)\n\t\t\t\t.remove()\n\t\t\t\t.attr('transform', () => `translate(${source.y},${source.x})`)\n\t\t\t\t.attr('fill-opacity', 0)\n\t\t\t\t.attr('stroke-opacity', 0)\n\n\t\t\t// Update data on links\n\t\t\tconst linkPaths = linkGroup.selectAll('path').data(links, (d: any) => d.target.id)\n\n\t\t\t// Add any entering link paths\n\t\t\tconst linkPathsEnter = linkPaths\n\t\t\t\t.enter()\n\t\t\t\t.append('path')\n\t\t\t\t.attr('d', () => {\n\t\t\t\t\tconst o = { x: source.x0, y: source.y0 }\n\t\t\t\t\treturn diagonal({ source: o, target: o })\n\t\t\t\t})\n\n\t\t\t// Reposition updating link paths\n\t\t\tlinkPaths.merge(linkPathsEnter).transition(transition).attr('d', diagonal)\n\n\t\t\t// Remove any exiting link paths\n\t\t\tlinkPaths\n\t\t\t\t.exit()\n\t\t\t\t.transition(transition)\n\t\t\t\t.remove()\n\t\t\t\t.attr('d', () => {\n\t\t\t\t\tconst o = { x: source.x, y: source.y }\n\t\t\t\t\treturn diagonal({ source: o, target: o })\n\t\t\t\t})\n\n\t\t\t// Update position data for nodes\n\t\t\troot.eachBefore((d: Coordinates) => {\n\t\t\t\td.x0 = d.x\n\t\t\t\td.y0 = d.y\n\t\t\t})\n\t\t}\n\n\t\tconst descendants = root.descendants()\n\t\tconst maxDepth = descendants[descendants.length - 1].depth\n\n\t\tconst tree =\n\t\t\tgetProperty(options, 'tree', 'type') === TreeTypes.DENDROGRAM\n\t\t\t\t? d3Cluster().size([\n\t\t\t\t\t\theight,\n\t\t\t\t\t\twidth - mockLongestLabelWidth - maxDepth * NODE_OFFSET - mockRootTitleWidth\n\t\t\t\t\t])\n\t\t\t\t: d3Tree()\n\t\t\t\t\t\t.nodeSize([dx, dy])\n\t\t\t\t\t\t.size([\n\t\t\t\t\t\t\theight,\n\t\t\t\t\t\t\twidth - mockLongestLabelWidth - maxDepth * NODE_OFFSET - mockRootTitleWidth\n\t\t\t\t\t\t])\n\n\t\tconst diagonal = linkHorizontal()\n\t\t\t.x((d: any) => d.y)\n\t\t\t.y((d: any) => d.x) as any\n\n\t\troot.x0 = dy / 2\n\t\troot.y0 = 0\n\t\troot.descendants().forEach((d: any, i: number) => {\n\t\t\td.id = i\n\t\t\td._children = d.children\n\t\t})\n\n\t\ttree(root)\n\n\t\tsvg.attr('viewBox', [-margin.left, -margin.top, width, dx]).style('user-select', 'none')\n\n\t\tconst linkGroup = svg.append('g').attr('class', 'links')\n\t\tconst nodeGroup = svg.append('g').attr('class', 'nodes')\n\n\t\tupdate(root)\n\t}\n}\n","/**\n * Copyright IBM Corp. 2018, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar black = '#000000';\nvar black100 = black;\nvar blackHover = '#212121';\nvar white = '#ffffff';\nvar white0 = white;\nvar whiteHover = '#e8e8e8';\nvar yellow10 = '#fcf4d6';\nvar yellow20 = '#fddc69';\nvar yellow30 = '#f1c21b';\nvar yellow40 = '#d2a106';\nvar yellow50 = '#b28600';\nvar yellow60 = '#8e6a00';\nvar yellow70 = '#684e00';\nvar yellow80 = '#483700';\nvar yellow90 = '#302400';\nvar yellow100 = '#1c1500';\nvar yellow = {\n 10: yellow10,\n 20: yellow20,\n 30: yellow30,\n 40: yellow40,\n 50: yellow50,\n 60: yellow60,\n 70: yellow70,\n 80: yellow80,\n 90: yellow90,\n 100: yellow100\n};\nvar yellow10Hover = '#f8e6a0';\nvar yellow20Hover = '#fccd27';\nvar yellow30Hover = '#ddb00e';\nvar yellow40Hover = '#bc9005';\nvar yellow50Hover = '#9e7700';\nvar yellow60Hover = '#755800';\nvar yellow70Hover = '#806000';\nvar yellow80Hover = '#5c4600';\nvar yellow90Hover = '#3d2e00';\nvar yellow100Hover = '#332600';\nvar yellowHover = {\n 10: yellow10Hover,\n 20: yellow20Hover,\n 30: yellow30Hover,\n 40: yellow40Hover,\n 50: yellow50Hover,\n 60: yellow60Hover,\n 70: yellow70Hover,\n 80: yellow80Hover,\n 90: yellow90Hover,\n 100: yellow100Hover\n};\nvar orange10 = '#fff2e8';\nvar orange20 = '#ffd9be';\nvar orange30 = '#ffb784';\nvar orange40 = '#ff832b';\nvar orange50 = '#eb6200';\nvar orange60 = '#ba4e00';\nvar orange70 = '#8a3800';\nvar orange80 = '#5e2900';\nvar orange90 = '#3e1a00';\nvar orange100 = '#231000';\nvar orange = {\n 10: orange10,\n 20: orange20,\n 30: orange30,\n 40: orange40,\n 50: orange50,\n 60: orange60,\n 70: orange70,\n 80: orange80,\n 90: orange90,\n 100: orange100\n};\nvar orange10Hover = '#ffe2cc';\nvar orange20Hover = '#ffc69e';\nvar orange30Hover = '#ff9d57';\nvar orange40Hover = '#fa6800';\nvar orange50Hover = '#cc5500';\nvar orange60Hover = '#9e4200';\nvar orange70Hover = '#a84400';\nvar orange80Hover = '#753300';\nvar orange90Hover = '#522200';\nvar orange100Hover = '#421e00';\nvar orangeHover = {\n 10: orange10Hover,\n 20: orange20Hover,\n 30: orange30Hover,\n 40: orange40Hover,\n 50: orange50Hover,\n 60: orange60Hover,\n 70: orange70Hover,\n 80: orange80Hover,\n 90: orange90Hover,\n 100: orange100Hover\n};\nvar red10 = '#fff1f1';\nvar red20 = '#ffd7d9';\nvar red30 = '#ffb3b8';\nvar red40 = '#ff8389';\nvar red50 = '#fa4d56';\nvar red60 = '#da1e28';\nvar red70 = '#a2191f';\nvar red80 = '#750e13';\nvar red90 = '#520408';\nvar red100 = '#2d0709';\nvar red = {\n 10: red10,\n 20: red20,\n 30: red30,\n 40: red40,\n 50: red50,\n 60: red60,\n 70: red70,\n 80: red80,\n 90: red90,\n 100: red100\n};\nvar red100Hover = '#540d11';\nvar red90Hover = '#66050a';\nvar red80Hover = '#921118';\nvar red70Hover = '#c21e25';\nvar red60Hover = '#b81922';\nvar red50Hover = '#ee0713';\nvar red40Hover = '#ff6168';\nvar red30Hover = '#ff99a0';\nvar red20Hover = '#ffc2c5';\nvar red10Hover = '#ffe0e0';\nvar redHover = {\n 100: red100Hover,\n 90: red90Hover,\n 80: red80Hover,\n 70: red70Hover,\n 60: red60Hover,\n 50: red50Hover,\n 40: red40Hover,\n 30: red30Hover,\n 20: red20Hover,\n 10: red10Hover\n};\nvar magenta10 = '#fff0f7';\nvar magenta20 = '#ffd6e8';\nvar magenta30 = '#ffafd2';\nvar magenta40 = '#ff7eb6';\nvar magenta50 = '#ee5396';\nvar magenta60 = '#d02670';\nvar magenta70 = '#9f1853';\nvar magenta80 = '#740937';\nvar magenta90 = '#510224';\nvar magenta100 = '#2a0a18';\nvar magenta = {\n 10: magenta10,\n 20: magenta20,\n 30: magenta30,\n 40: magenta40,\n 50: magenta50,\n 60: magenta60,\n 70: magenta70,\n 80: magenta80,\n 90: magenta90,\n 100: magenta100\n};\nvar magenta100Hover = '#53142f';\nvar magenta90Hover = '#68032e';\nvar magenta80Hover = '#8e0b43';\nvar magenta70Hover = '#bf1d63';\nvar magenta60Hover = '#b0215f';\nvar magenta50Hover = '#e3176f';\nvar magenta40Hover = '#ff57a0';\nvar magenta30Hover = '#ff94c3';\nvar magenta20Hover = '#ffbdda';\nvar magenta10Hover = '#ffe0ef';\nvar magentaHover = {\n 100: magenta100Hover,\n 90: magenta90Hover,\n 80: magenta80Hover,\n 70: magenta70Hover,\n 60: magenta60Hover,\n 50: magenta50Hover,\n 40: magenta40Hover,\n 30: magenta30Hover,\n 20: magenta20Hover,\n 10: magenta10Hover\n};\nvar purple10 = '#f6f2ff';\nvar purple20 = '#e8daff';\nvar purple30 = '#d4bbff';\nvar purple40 = '#be95ff';\nvar purple50 = '#a56eff';\nvar purple60 = '#8a3ffc';\nvar purple70 = '#6929c4';\nvar purple80 = '#491d8b';\nvar purple90 = '#31135e';\nvar purple100 = '#1c0f30';\nvar purple = {\n 10: purple10,\n 20: purple20,\n 30: purple30,\n 40: purple40,\n 50: purple50,\n 60: purple60,\n 70: purple70,\n 80: purple80,\n 90: purple90,\n 100: purple100\n};\nvar purple100Hover = '#341c59';\nvar purple90Hover = '#40197b';\nvar purple80Hover = '#5b24ad';\nvar purple70Hover = '#7c3dd6';\nvar purple60Hover = '#7822fb';\nvar purple50Hover = '#9352ff';\nvar purple40Hover = '#ae7aff';\nvar purple30Hover = '#c5a3ff';\nvar purple20Hover = '#dcc7ff';\nvar purple10Hover = '#ede5ff';\nvar purpleHover = {\n 100: purple100Hover,\n 90: purple90Hover,\n 80: purple80Hover,\n 70: purple70Hover,\n 60: purple60Hover,\n 50: purple50Hover,\n 40: purple40Hover,\n 30: purple30Hover,\n 20: purple20Hover,\n 10: purple10Hover\n};\nvar blue10 = '#edf5ff';\nvar blue20 = '#d0e2ff';\nvar blue30 = '#a6c8ff';\nvar blue40 = '#78a9ff';\nvar blue50 = '#4589ff';\nvar blue60 = '#0f62fe';\nvar blue70 = '#0043ce';\nvar blue80 = '#002d9c';\nvar blue90 = '#001d6c';\nvar blue100 = '#001141';\nvar blue = {\n 10: blue10,\n 20: blue20,\n 30: blue30,\n 40: blue40,\n 50: blue50,\n 60: blue60,\n 70: blue70,\n 80: blue80,\n 90: blue90,\n 100: blue100\n};\nvar blue100Hover = '#001f75';\nvar blue90Hover = '#00258a';\nvar blue80Hover = '#0039c7';\nvar blue70Hover = '#0053ff';\nvar blue60Hover = '#0050e6';\nvar blue50Hover = '#1f70ff';\nvar blue40Hover = '#5c97ff';\nvar blue30Hover = '#8ab6ff';\nvar blue20Hover = '#b8d3ff';\nvar blue10Hover = '#dbebff';\nvar blueHover = {\n 100: blue100Hover,\n 90: blue90Hover,\n 80: blue80Hover,\n 70: blue70Hover,\n 60: blue60Hover,\n 50: blue50Hover,\n 40: blue40Hover,\n 30: blue30Hover,\n 20: blue20Hover,\n 10: blue10Hover\n};\nvar cyan10 = '#e5f6ff';\nvar cyan20 = '#bae6ff';\nvar cyan30 = '#82cfff';\nvar cyan40 = '#33b1ff';\nvar cyan50 = '#1192e8';\nvar cyan60 = '#0072c3';\nvar cyan70 = '#00539a';\nvar cyan80 = '#003a6d';\nvar cyan90 = '#012749';\nvar cyan100 = '#061727';\nvar cyan = {\n 10: cyan10,\n 20: cyan20,\n 30: cyan30,\n 40: cyan40,\n 50: cyan50,\n 60: cyan60,\n 70: cyan70,\n 80: cyan80,\n 90: cyan90,\n 100: cyan100\n};\nvar cyan10Hover = '#cceeff';\nvar cyan20Hover = '#99daff';\nvar cyan30Hover = '#57beff';\nvar cyan40Hover = '#059fff';\nvar cyan50Hover = '#0f7ec8';\nvar cyan60Hover = '#005fa3';\nvar cyan70Hover = '#0066bd';\nvar cyan80Hover = '#00498a';\nvar cyan90Hover = '#013360';\nvar cyan100Hover = '#0b2947';\nvar cyanHover = {\n 10: cyan10Hover,\n 20: cyan20Hover,\n 30: cyan30Hover,\n 40: cyan40Hover,\n 50: cyan50Hover,\n 60: cyan60Hover,\n 70: cyan70Hover,\n 80: cyan80Hover,\n 90: cyan90Hover,\n 100: cyan100Hover\n};\nvar teal10 = '#d9fbfb';\nvar teal20 = '#9ef0f0';\nvar teal30 = '#3ddbd9';\nvar teal40 = '#08bdba';\nvar teal50 = '#009d9a';\nvar teal60 = '#007d79';\nvar teal70 = '#005d5d';\nvar teal80 = '#004144';\nvar teal90 = '#022b30';\nvar teal100 = '#081a1c';\nvar teal = {\n 10: teal10,\n 20: teal20,\n 30: teal30,\n 40: teal40,\n 50: teal50,\n 60: teal60,\n 70: teal70,\n 80: teal80,\n 90: teal90,\n 100: teal100\n};\nvar teal10Hover = '#acf6f6';\nvar teal20Hover = '#57e5e5';\nvar teal30Hover = '#25cac8';\nvar teal40Hover = '#07aba9';\nvar teal50Hover = '#008a87';\nvar teal60Hover = '#006b68';\nvar teal70Hover = '#007070';\nvar teal80Hover = '#005357';\nvar teal90Hover = '#033940';\nvar teal100Hover = '#0f3034';\nvar tealHover = {\n 10: teal10Hover,\n 20: teal20Hover,\n 30: teal30Hover,\n 40: teal40Hover,\n 50: teal50Hover,\n 60: teal60Hover,\n 70: teal70Hover,\n 80: teal80Hover,\n 90: teal90Hover,\n 100: teal100Hover\n};\nvar green10 = '#defbe6';\nvar green20 = '#a7f0ba';\nvar green30 = '#6fdc8c';\nvar green40 = '#42be65';\nvar green50 = '#24a148';\nvar green60 = '#198038';\nvar green70 = '#0e6027';\nvar green80 = '#044317';\nvar green90 = '#022d0d';\nvar green100 = '#071908';\nvar green = {\n 10: green10,\n 20: green20,\n 30: green30,\n 40: green40,\n 50: green50,\n 60: green60,\n 70: green70,\n 80: green80,\n 90: green90,\n 100: green100\n};\nvar green10Hover = '#b6f6c8';\nvar green20Hover = '#74e792';\nvar green30Hover = '#36ce5e';\nvar green40Hover = '#3bab5a';\nvar green50Hover = '#208e3f';\nvar green60Hover = '#166f31';\nvar green70Hover = '#11742f';\nvar green80Hover = '#05521c';\nvar green90Hover = '#033b11';\nvar green100Hover = '#0d300f';\nvar greenHover = {\n 10: green10Hover,\n 20: green20Hover,\n 30: green30Hover,\n 40: green40Hover,\n 50: green50Hover,\n 60: green60Hover,\n 70: green70Hover,\n 80: green80Hover,\n 90: green90Hover,\n 100: green100Hover\n};\nvar coolGray10 = '#f2f4f8';\nvar coolGray20 = '#dde1e6';\nvar coolGray30 = '#c1c7cd';\nvar coolGray40 = '#a2a9b0';\nvar coolGray50 = '#878d96';\nvar coolGray60 = '#697077';\nvar coolGray70 = '#4d5358';\nvar coolGray80 = '#343a3f';\nvar coolGray90 = '#21272a';\nvar coolGray100 = '#121619';\nvar coolGray = {\n 10: coolGray10,\n 20: coolGray20,\n 30: coolGray30,\n 40: coolGray40,\n 50: coolGray50,\n 60: coolGray60,\n 70: coolGray70,\n 80: coolGray80,\n 90: coolGray90,\n 100: coolGray100\n};\nvar coolGray10Hover = '#e4e9f1';\nvar coolGray20Hover = '#cdd3da';\nvar coolGray30Hover = '#adb5bd';\nvar coolGray40Hover = '#9199a1';\nvar coolGray50Hover = '#757b85';\nvar coolGray60Hover = '#585e64';\nvar coolGray70Hover = '#5d646a';\nvar coolGray80Hover = '#434a51';\nvar coolGray90Hover = '#2b3236';\nvar coolGray100Hover = '#222a2f';\nvar coolGrayHover = {\n 10: coolGray10Hover,\n 20: coolGray20Hover,\n 30: coolGray30Hover,\n 40: coolGray40Hover,\n 50: coolGray50Hover,\n 60: coolGray60Hover,\n 70: coolGray70Hover,\n 80: coolGray80Hover,\n 90: coolGray90Hover,\n 100: coolGray100Hover\n};\nvar gray10 = '#f4f4f4';\nvar gray20 = '#e0e0e0';\nvar gray30 = '#c6c6c6';\nvar gray40 = '#a8a8a8';\nvar gray50 = '#8d8d8d';\nvar gray60 = '#6f6f6f';\nvar gray70 = '#525252';\nvar gray80 = '#393939';\nvar gray90 = '#262626';\nvar gray100 = '#161616';\nvar gray = {\n 10: gray10,\n 20: gray20,\n 30: gray30,\n 40: gray40,\n 50: gray50,\n 60: gray60,\n 70: gray70,\n 80: gray80,\n 90: gray90,\n 100: gray100\n};\nvar gray10Hover = '#e8e8e8';\nvar gray20Hover = '#d1d1d1';\nvar gray30Hover = '#b5b5b5';\nvar gray40Hover = '#999999';\nvar gray50Hover = '#7a7a7a';\nvar gray60Hover = '#5e5e5e';\nvar gray70Hover = '#636363';\nvar gray80Hover = '#474747';\nvar gray90Hover = '#333333';\nvar gray100Hover = '#292929';\nvar grayHover = {\n 10: gray10Hover,\n 20: gray20Hover,\n 30: gray30Hover,\n 40: gray40Hover,\n 50: gray50Hover,\n 60: gray60Hover,\n 70: gray70Hover,\n 80: gray80Hover,\n 90: gray90Hover,\n 100: gray100Hover\n};\nvar warmGray10 = '#f7f3f2';\nvar warmGray20 = '#e5e0df';\nvar warmGray30 = '#cac5c4';\nvar warmGray40 = '#ada8a8';\nvar warmGray50 = '#8f8b8b';\nvar warmGray60 = '#726e6e';\nvar warmGray70 = '#565151';\nvar warmGray80 = '#3c3838';\nvar warmGray90 = '#272525';\nvar warmGray100 = '#171414';\nvar warmGray = {\n 10: warmGray10,\n 20: warmGray20,\n 30: warmGray30,\n 40: warmGray40,\n 50: warmGray50,\n 60: warmGray60,\n 70: warmGray70,\n 80: warmGray80,\n 90: warmGray90,\n 100: warmGray100\n};\nvar warmGray10Hover = '#f0e8e6';\nvar warmGray20Hover = '#d8d0cf';\nvar warmGray30Hover = '#b9b3b1';\nvar warmGray40Hover = '#9c9696';\nvar warmGray50Hover = '#7f7b7b';\nvar warmGray60Hover = '#605d5d';\nvar warmGray70Hover = '#696363';\nvar warmGray80Hover = '#4c4848';\nvar warmGray90Hover = '#343232';\nvar warmGray100Hover = '#2c2626';\nvar warmGrayHover = {\n 10: warmGray10Hover,\n 20: warmGray20Hover,\n 30: warmGray30Hover,\n 40: warmGray40Hover,\n 50: warmGray50Hover,\n 60: warmGray60Hover,\n 70: warmGray70Hover,\n 80: warmGray80Hover,\n 90: warmGray90Hover,\n 100: warmGray100Hover\n};\nvar colors = {\n black: {\n 100: black\n },\n blue: blue,\n coolGray: coolGray,\n cyan: cyan,\n gray: gray,\n green: green,\n magenta: magenta,\n orange: orange,\n purple: purple,\n red: red,\n teal: teal,\n warmGray: warmGray,\n white: {\n 0: white\n },\n yellow: yellow\n};\nvar hoverColors = {\n whiteHover: whiteHover,\n blackHover: blackHover,\n blueHover: blueHover,\n coolGrayHover: coolGrayHover,\n cyanHover: cyanHover,\n grayHover: grayHover,\n greenHover: greenHover,\n magentaHover: magentaHover,\n orangeHover: orangeHover,\n purpleHover: purpleHover,\n redHover: redHover,\n tealHover: tealHover,\n warmGrayHover: warmGrayHover,\n yellowHover: yellowHover\n};\n\n/**\n * Copyright IBM Corp. 2018, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Parse a given hexcode string into an rgba statement with the given opacity\n * @param {string} hexcode\n * @param {number} opacity\n * @returns {string}\n */\nfunction rgba(hexcode, opacity) {\n var values = [hexcode.substring(1, 3), hexcode.substring(3, 5), hexcode.substring(5, 7)].map(function (string) {\n return parseInt(string, 16);\n });\n return \"rgba(\".concat(values[0], \", \").concat(values[1], \", \").concat(values[2], \", \").concat(opacity, \")\");\n}\n\nexport { black, black100, blackHover, blue, blue10, blue100, blue100Hover, blue10Hover, blue20, blue20Hover, blue30, blue30Hover, blue40, blue40Hover, blue50, blue50Hover, blue60, blue60Hover, blue70, blue70Hover, blue80, blue80Hover, blue90, blue90Hover, blueHover, colors, coolGray, coolGray10, coolGray100, coolGray100Hover, coolGray10Hover, coolGray20, coolGray20Hover, coolGray30, coolGray30Hover, coolGray40, coolGray40Hover, coolGray50, coolGray50Hover, coolGray60, coolGray60Hover, coolGray70, coolGray70Hover, coolGray80, coolGray80Hover, coolGray90, coolGray90Hover, coolGrayHover, cyan, cyan10, cyan100, cyan100Hover, cyan10Hover, cyan20, cyan20Hover, cyan30, cyan30Hover, cyan40, cyan40Hover, cyan50, cyan50Hover, cyan60, cyan60Hover, cyan70, cyan70Hover, cyan80, cyan80Hover, cyan90, cyan90Hover, cyanHover, gray, gray10, gray100, gray100Hover, gray10Hover, gray20, gray20Hover, gray30, gray30Hover, gray40, gray40Hover, gray50, gray50Hover, gray60, gray60Hover, gray70, gray70Hover, gray80, gray80Hover, gray90, gray90Hover, grayHover, green, green10, green100, green100Hover, green10Hover, green20, green20Hover, green30, green30Hover, green40, green40Hover, green50, green50Hover, green60, green60Hover, green70, green70Hover, green80, green80Hover, green90, green90Hover, greenHover, hoverColors, magenta, magenta10, magenta100, magenta100Hover, magenta10Hover, magenta20, magenta20Hover, magenta30, magenta30Hover, magenta40, magenta40Hover, magenta50, magenta50Hover, magenta60, magenta60Hover, magenta70, magenta70Hover, magenta80, magenta80Hover, magenta90, magenta90Hover, magentaHover, orange, orange10, orange100, orange100Hover, orange10Hover, orange20, orange20Hover, orange30, orange30Hover, orange40, orange40Hover, orange50, orange50Hover, orange60, orange60Hover, orange70, orange70Hover, orange80, orange80Hover, orange90, orange90Hover, orangeHover, purple, purple10, purple100, purple100Hover, purple10Hover, purple20, purple20Hover, purple30, purple30Hover, purple40, purple40Hover, purple50, purple50Hover, purple60, purple60Hover, purple70, purple70Hover, purple80, purple80Hover, purple90, purple90Hover, purpleHover, red, red10, red100, red100Hover, red10Hover, red20, red20Hover, red30, red30Hover, red40, red40Hover, red50, red50Hover, red60, red60Hover, red70, red70Hover, red80, red80Hover, red90, red90Hover, redHover, rgba, teal, teal10, teal100, teal100Hover, teal10Hover, teal20, teal20Hover, teal30, teal30Hover, teal40, teal40Hover, teal50, teal50Hover, teal60, teal60Hover, teal70, teal70Hover, teal80, teal80Hover, teal90, teal90Hover, tealHover, warmGray, warmGray10, warmGray100, warmGray100Hover, warmGray10Hover, warmGray20, warmGray20Hover, warmGray30, warmGray30Hover, warmGray40, warmGray40Hover, warmGray50, warmGray50Hover, warmGray60, warmGray60Hover, warmGray70, warmGray70Hover, warmGray80, warmGray80Hover, warmGray90, warmGray90Hover, warmGrayHover, white, white0, whiteHover, yellow, yellow10, yellow100, yellow100Hover, yellow10Hover, yellow20, yellow20Hover, yellow30, yellow30Hover, yellow40, yellow40Hover, yellow50, yellow50Hover, yellow60, yellow60Hover, yellow70, yellow70Hover, yellow80, yellow80Hover, yellow90, yellow90Hover, yellowHover };\n","import { color as d3Color, hierarchy as d3Hierarchy, hsl, treemap as d3Treemap, select } from 'd3'\nimport { colors } from '@carbon/colors'\nimport { getProperty } from '@/tools'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { Events, ColorClassNameTypes, RenderTypes } from '@/interfaces/enums'\n\nconst findColorShade = (hex: string) => {\n\tif (!hex) {\n\t\treturn null\n\t}\n\n\tfor (const colorName of Object.keys(colors)) {\n\t\tconst colorShades = colors[colorName as keyof typeof colors]\n\n\t\tfor (const colorShadeLevel of Object.keys(colorShades)) {\n\t\t\tconst colorShade = colorShades[+colorShadeLevel]\n\n\t\t\tif (colorShade === hex) {\n\t\t\t\treturn colorShadeLevel\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null\n}\n\nconst textFillColor = function () {\n\tconst correspondingLeaf = select(this.parentNode).select('rect.leaf') as any\n\tconst correspondingLeafFill = getComputedStyle(correspondingLeaf.node(), null).getPropertyValue(\n\t\t'fill'\n\t)\n\tconst cl = d3Color(correspondingLeafFill) as any\n\n\tlet colorShade: any\n\tif (cl) {\n\t\tcolorShade = findColorShade(cl ? cl.hex() : null)\n\t}\n\n\tif (colorShade === null || colorShade === undefined) {\n\t\tconst lightness = hsl(cl).l\n\t\tcolorShade = Math.abs(lightness * 100 - 100)\n\t}\n\n\treturn colorShade > 50 ? 'white' : 'black'\n}\n\nlet uidCounter = 0\nexport class Treemap extends Component {\n\ttype = 'treemap'\n\trenderType = RenderTypes.SVG\n\n\tinit() {\n\t\tconst { events } = this.services\n\t\t// Highlight correct circle on legend item hovers\n\t\tevents.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\t// Un-highlight circles on legend item mouseouts\n\t\tevents.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer()\n\n\t\tthis.model.getData()\n\t\tconst displayData = this.model.getDisplayData()\n\t\tconst options = this.model.getOptions()\n\n\t\tconst windowLocation = getProperty(window, 'location')\n\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tconst hierarchy = d3Hierarchy({\n\t\t\tname: options.title || 'Treemap',\n\t\t\tchildren: displayData\n\t\t})\n\t\t\t.sum((d: any) => d.value)\n\t\t\t.sort((a, b) => b.value - a.value)\n\n\t\tconst root = d3Treemap().size([width, height]).paddingInner(1).paddingOuter(0).round(true)(\n\t\t\thierarchy\n\t\t)\n\n\t\tconst leafGroups = svg\n\t\t\t.selectAll(\"g[data-name='leaf']\")\n\t\t\t.data(root.leaves(), (leaf: any) => leaf.data.name)\n\n\t\t// Remove leaf groups that need to be removed\n\t\tleafGroups.exit().attr('opacity', 0).remove()\n\n\t\t// Add the leaf groups that need to be introduced\n\t\tconst enteringLeafGroups = leafGroups\n\t\t\t.enter()\n\t\t\t.append('g')\n\t\t\t.attr('data-name', 'leaf')\n\t\t\t.attr('data-uid', () => uidCounter++)\n\n\t\tconst allLeafGroups = enteringLeafGroups.merge(leafGroups as any)\n\n\t\tallLeafGroups\n\t\t\t.attr('data-name', 'leaf')\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'treemap-group-update',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('transform', (d: any) => `translate(${d.x0},${d.y0})`)\n\n\t\tconst rects = allLeafGroups.selectAll('rect.leaf').data((d: any) => [d])\n\n\t\trects.exit().attr('width', 0).attr('height', 0).remove()\n\n\t\tconst enteringRects = rects.enter().append('rect').classed('leaf', true)\n\n\t\tenteringRects\n\t\t\t.merge(rects as any)\n\t\t\t.attr('width', 0)\n\t\t\t.attr('height', 0)\n\t\t\t.attr('id', function () {\n\t\t\t\tconst uid: any = select(this.parentNode as any).attr('data-uid')\n\t\t\t\treturn `${options.style.prefix}-leaf-${uid}`\n\t\t\t})\n\t\t\t.attr('class', (d: any) => {\n\t\t\t\twhile (d.depth > 1) d = d.parent\n\n\t\t\t\treturn this.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: d.data.name,\n\t\t\t\t\toriginalClassName: 'leaf'\n\t\t\t\t})\n\t\t\t})\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'treemap-leaf-update-enter',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('width', (d: any) => d.x1 - d.x0)\n\t\t\t.attr('height', (d: any) => d.y1 - d.y0)\n\t\t\t.style('fill', (d: any) => {\n\t\t\t\twhile (d.depth > 1) d = d.parent\n\t\t\t\treturn this.model.getFillColor(d.data.name)\n\t\t\t})\n\n\t\t// Update all clip paths\n\t\tallLeafGroups\n\t\t\t.selectAll('clipPath')\n\t\t\t.data(\n\t\t\t\t(d: any) => {\n\t\t\t\t\tif (d.data.showLabel !== true) {\n\t\t\t\t\t\treturn []\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [1]\n\t\t\t\t},\n\t\t\t\t(d: any) => d\n\t\t\t)\n\t\t\t.join(\n\t\t\t\t(enter: any) => {\n\t\t\t\t\treturn enter\n\t\t\t\t\t\t.append('clipPath')\n\t\t\t\t\t\t.attr('id', function () {\n\t\t\t\t\t\t\tconst uid = select(this.parentNode).attr('data-uid')\n\t\t\t\t\t\t\treturn `${options.style.prefix}-clip-${uid}`\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.append('use')\n\t\t\t\t\t\t.attr('xlink:href', function () {\n\t\t\t\t\t\t\tconst uid = select(this.parentNode.parentNode).attr('data-uid')\n\t\t\t\t\t\t\tconst leafID = `${options.style.prefix}-leaf-${uid}`\n\n\t\t\t\t\t\t\treturn new URL(`#${leafID}`, windowLocation) + ''\n\t\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t\t// @ts-ignore\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\t\t\t\t(update: any) => null as any,\n\t\t\t\t(exit: any) => exit.remove()\n\t\t\t)\n\n\t\t// Update all titles\n\t\tallLeafGroups\n\t\t\t.selectAll('text')\n\t\t\t.data(\n\t\t\t\t(d: any) => {\n\t\t\t\t\tif (d.data.showLabel !== true) {\n\t\t\t\t\t\treturn []\n\t\t\t\t\t}\n\n\t\t\t\t\tlet parent = d\n\t\t\t\t\twhile (parent.depth > 1) parent = parent.parent\n\t\t\t\t\tconst color = hsl(this.model.getFillColor(parent.data.name))\n\t\t\t\t\treturn [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttext: d.data.name,\n\t\t\t\t\t\t\tcolor: color.l < 0.5 ? 'white' : 'black'\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t(d: any) => d\n\t\t\t)\n\t\t\t.join(\n\t\t\t\t(enter: any) => {\n\t\t\t\t\tconst addedText = enter\n\t\t\t\t\t\t.append('text')\n\t\t\t\t\t\t.text((d: any) => d.text)\n\t\t\t\t\t\t.style('fill', textFillColor)\n\t\t\t\t\t\t.attr('x', 7)\n\t\t\t\t\t\t.attr('y', 18)\n\n\t\t\t\t\tif (windowLocation) {\n\t\t\t\t\t\taddedText.attr('clip-path', function () {\n\t\t\t\t\t\t\tconst uid = select(this.parentNode).attr('data-uid')\n\t\t\t\t\t\t\tconst clipPathID = `${options.style.prefix}-clip-${uid}`\n\n\t\t\t\t\t\t\treturn `url(${new URL(`#${clipPathID}`, windowLocation) + ''})`\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\treturn addedText\n\t\t\t\t},\n\t\t\t\t(update: any) => update.text((d: any) => d.text).style('fill', textFillColor),\n\t\t\t\t(exit: any) => exit.remove()\n\t\t\t)\n\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners()\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this\n\t\tthis.parent\n\t\t\t.selectAll('rect.leaf')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\tlet fillColor = getComputedStyle(this as Element, null).getPropertyValue('fill')\n\n\t\t\t\tlet parent = datum\n\t\t\t\twhile (parent.depth > 1) parent = parent.parent\n\n\t\t\t\thoveredElement\n\t\t\t\t\t.transition('graph_element_mouseover_fill_update')\n\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\tname: 'graph_element_mouseover_fill_update'\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.style('fill', (d: any) => {\n\t\t\t\t\t\tconst customColor = self.model.getFillColor(d.parent.data.name)\n\t\t\t\t\t\tif (customColor) {\n\t\t\t\t\t\t\tfillColor = customColor\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn d3Color(fillColor).darker(0.7).toString()\n\t\t\t\t\t})\n\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcolor: fillColor,\n\t\t\t\t\t\t\tlabel: parent.data.name,\n\t\t\t\t\t\t\tbold: true\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: datum.data.name,\n\t\t\t\t\t\t\tvalue: datum.data.value\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t})\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Treemap.LEAF_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Treemap.LEAF_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Treemap.LEAF_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', false)\n\n\t\t\t\tlet parent = datum\n\t\t\t\twhile (parent.depth > 1) parent = parent.parent\n\n\t\t\t\thoveredElement\n\t\t\t\t\t.transition()\n\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\tname: 'graph_element_mouseout_fill_update'\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.style('fill', (d: any) => self.model.getFillColor(d.parent.data.name))\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Treemap.LEAF_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\n\t\tthis.parent\n\t\t\t.selectAll(\"g[data-name='leaf']\")\n\t\t\t.transition('legend-hover-treemap')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-treemap'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) =>\n\t\t\t\td.parent.data.name === hoveredElement.datum()['name'] ? 1 : 0.3\n\t\t\t)\n\t}\n\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll(\"g[data-name='leaf']\")\n\t\t\t.transition('legend-mouseout-treemap')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-treemap'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n}\n","var noop = {value: function() {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexport default dispatch;\n","// Word cloud layout by Jason Davies, https://www.jasondavies.com/wordcloud/\n// Algorithm due to Jonathan Feinberg, https://s3.amazonaws.com/static.mrfeinberg.com/bv_ch03.pdf\n\nconst dispatch = require(\"d3-dispatch\").dispatch;\n\nconst RADIANS = Math.PI / 180;\n\nconst SPIRALS = {\n archimedean: archimedeanSpiral,\n rectangular: rectangularSpiral\n};\n\nconst cw = 1 << 11 >> 5;\nconst ch = 1 << 11;\n\nmodule.exports = function() {\n var size = [256, 256],\n text = cloudText,\n font = cloudFont,\n fontSize = cloudFontSize,\n fontStyle = cloudFontNormal,\n fontWeight = cloudFontNormal,\n rotate = cloudRotate,\n padding = cloudPadding,\n spiral = archimedeanSpiral,\n words = [],\n timeInterval = Infinity,\n event = dispatch(\"word\", \"end\"),\n timer = null,\n random = Math.random,\n cloud = {},\n canvas = cloudCanvas;\n\n cloud.canvas = function(_) {\n return arguments.length ? (canvas = functor(_), cloud) : canvas;\n };\n\n cloud.start = function() {\n var contextAndRatio = getContext(canvas()),\n board = zeroArray((size[0] >> 5) * size[1]),\n bounds = null,\n n = words.length,\n i = -1,\n tags = [],\n data = words.map(function(d, i) {\n d.text = text.call(this, d, i);\n d.font = font.call(this, d, i);\n d.style = fontStyle.call(this, d, i);\n d.weight = fontWeight.call(this, d, i);\n d.rotate = rotate.call(this, d, i);\n d.size = ~~fontSize.call(this, d, i);\n d.padding = padding.call(this, d, i);\n return d;\n }).sort(function(a, b) { return b.size - a.size; });\n\n if (timer) clearInterval(timer);\n timer = setInterval(step, 0);\n step();\n\n return cloud;\n\n function step() {\n var start = Date.now();\n while (Date.now() - start < timeInterval && ++i < n && timer) {\n var d = data[i];\n d.x = (size[0] * (random() + .5)) >> 1;\n d.y = (size[1] * (random() + .5)) >> 1;\n cloudSprite(contextAndRatio, d, data, i);\n if (d.hasText && place(board, d, bounds)) {\n tags.push(d);\n event.call(\"word\", cloud, d);\n if (bounds) cloudBounds(bounds, d);\n else bounds = [{x: d.x + d.x0, y: d.y + d.y0}, {x: d.x + d.x1, y: d.y + d.y1}];\n // Temporary hack\n d.x -= size[0] >> 1;\n d.y -= size[1] >> 1;\n }\n }\n if (i >= n) {\n cloud.stop();\n event.call(\"end\", cloud, tags, bounds);\n }\n }\n }\n\n cloud.stop = function() {\n if (timer) {\n clearInterval(timer);\n timer = null;\n }\n for (const d of words) {\n delete d.sprite;\n }\n return cloud;\n };\n\n function getContext(canvas) {\n const context = canvas.getContext(\"2d\", {willReadFrequently: true});\n\n canvas.width = canvas.height = 1;\n const ratio = Math.sqrt(context.getImageData(0, 0, 1, 1).data.length >> 2);\n canvas.width = (cw << 5) / ratio;\n canvas.height = ch / ratio;\n\n context.fillStyle = context.strokeStyle = \"red\";\n\n return {context, ratio};\n }\n\n function place(board, tag, bounds) {\n var perimeter = [{x: 0, y: 0}, {x: size[0], y: size[1]}],\n startX = tag.x,\n startY = tag.y,\n maxDelta = Math.sqrt(size[0] * size[0] + size[1] * size[1]),\n s = spiral(size),\n dt = random() < .5 ? 1 : -1,\n t = -dt,\n dxdy,\n dx,\n dy;\n\n while (dxdy = s(t += dt)) {\n dx = ~~dxdy[0];\n dy = ~~dxdy[1];\n\n if (Math.min(Math.abs(dx), Math.abs(dy)) >= maxDelta) break;\n\n tag.x = startX + dx;\n tag.y = startY + dy;\n\n if (tag.x + tag.x0 < 0 || tag.y + tag.y0 < 0 ||\n tag.x + tag.x1 > size[0] || tag.y + tag.y1 > size[1]) continue;\n // TODO only check for collisions within current bounds.\n if (!bounds || collideRects(tag, bounds)) {\n if (!cloudCollide(tag, board, size[0])) {\n var sprite = tag.sprite,\n w = tag.width >> 5,\n sw = size[0] >> 5,\n lx = tag.x - (w << 4),\n sx = lx & 0x7f,\n msx = 32 - sx,\n h = tag.y1 - tag.y0,\n x = (tag.y + tag.y0) * sw + (lx >> 5),\n last;\n for (var j = 0; j < h; j++) {\n last = 0;\n for (var i = 0; i <= w; i++) {\n board[x + i] |= (last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0);\n }\n x += sw;\n }\n return true;\n }\n }\n }\n return false;\n }\n\n cloud.timeInterval = function(_) {\n return arguments.length ? (timeInterval = _ == null ? Infinity : _, cloud) : timeInterval;\n };\n\n cloud.words = function(_) {\n return arguments.length ? (words = _, cloud) : words;\n };\n\n cloud.size = function(_) {\n return arguments.length ? (size = [+_[0], +_[1]], cloud) : size;\n };\n\n cloud.font = function(_) {\n return arguments.length ? (font = functor(_), cloud) : font;\n };\n\n cloud.fontStyle = function(_) {\n return arguments.length ? (fontStyle = functor(_), cloud) : fontStyle;\n };\n\n cloud.fontWeight = function(_) {\n return arguments.length ? (fontWeight = functor(_), cloud) : fontWeight;\n };\n\n cloud.rotate = function(_) {\n return arguments.length ? (rotate = functor(_), cloud) : rotate;\n };\n\n cloud.text = function(_) {\n return arguments.length ? (text = functor(_), cloud) : text;\n };\n\n cloud.spiral = function(_) {\n return arguments.length ? (spiral = SPIRALS[_] || _, cloud) : spiral;\n };\n\n cloud.fontSize = function(_) {\n return arguments.length ? (fontSize = functor(_), cloud) : fontSize;\n };\n\n cloud.padding = function(_) {\n return arguments.length ? (padding = functor(_), cloud) : padding;\n };\n\n cloud.random = function(_) {\n return arguments.length ? (random = _, cloud) : random;\n };\n\n cloud.on = function() {\n var value = event.on.apply(event, arguments);\n return value === event ? cloud : value;\n };\n\n return cloud;\n};\n\nfunction cloudText(d) {\n return d.text;\n}\n\nfunction cloudFont() {\n return \"serif\";\n}\n\nfunction cloudFontNormal() {\n return \"normal\";\n}\n\nfunction cloudFontSize(d) {\n return Math.sqrt(d.value);\n}\n\nfunction cloudRotate() {\n return (~~(random() * 6) - 3) * 30;\n}\n\nfunction cloudPadding() {\n return 1;\n}\n\n// Fetches a monochrome sprite bitmap for the specified text.\n// Load in batches for speed.\nfunction cloudSprite(contextAndRatio, d, data, di) {\n if (d.sprite) return;\n var c = contextAndRatio.context,\n ratio = contextAndRatio.ratio;\n\n c.clearRect(0, 0, (cw << 5) / ratio, ch / ratio);\n var x = 0,\n y = 0,\n maxh = 0,\n n = data.length;\n --di;\n while (++di < n) {\n d = data[di];\n c.save();\n c.font = d.style + \" \" + d.weight + \" \" + ~~((d.size + 1) / ratio) + \"px \" + d.font;\n const metrics = c.measureText(d.text);\n const anchor = -Math.floor(metrics.width / 2);\n let w = (metrics.width + 1) * ratio;\n let h = d.size << 1;\n if (d.rotate) {\n var sr = Math.sin(d.rotate * RADIANS),\n cr = Math.cos(d.rotate * RADIANS),\n wcr = w * cr,\n wsr = w * sr,\n hcr = h * cr,\n hsr = h * sr;\n w = (Math.max(Math.abs(wcr + hsr), Math.abs(wcr - hsr)) + 0x1f) >> 5 << 5;\n h = ~~Math.max(Math.abs(wsr + hcr), Math.abs(wsr - hcr));\n } else {\n w = (w + 0x1f) >> 5 << 5;\n }\n if (h > maxh) maxh = h;\n if (x + w >= (cw << 5)) {\n x = 0;\n y += maxh;\n maxh = 0;\n }\n if (y + h >= ch) break;\n c.translate((x + (w >> 1)) / ratio, (y + (h >> 1)) / ratio);\n if (d.rotate) c.rotate(d.rotate * RADIANS);\n c.fillText(d.text, anchor, 0);\n if (d.padding) c.lineWidth = 2 * d.padding, c.strokeText(d.text, anchor, 0);\n c.restore();\n d.width = w;\n d.height = h;\n d.xoff = x;\n d.yoff = y;\n d.x1 = w >> 1;\n d.y1 = h >> 1;\n d.x0 = -d.x1;\n d.y0 = -d.y1;\n d.hasText = true;\n x += w;\n }\n var pixels = c.getImageData(0, 0, (cw << 5) / ratio, ch / ratio).data,\n sprite = [];\n while (--di >= 0) {\n d = data[di];\n if (!d.hasText) continue;\n var w = d.width,\n w32 = w >> 5,\n h = d.y1 - d.y0;\n // Zero the buffer\n for (var i = 0; i < h * w32; i++) sprite[i] = 0;\n x = d.xoff;\n if (x == null) return;\n y = d.yoff;\n var seen = 0,\n seenRow = -1;\n for (var j = 0; j < h; j++) {\n for (var i = 0; i < w; i++) {\n var k = w32 * j + (i >> 5),\n m = pixels[((y + j) * (cw << 5) + (x + i)) << 2] ? 1 << (31 - (i % 32)) : 0;\n sprite[k] |= m;\n seen |= m;\n }\n if (seen) seenRow = j;\n else {\n d.y0++;\n h--;\n j--;\n y++;\n }\n }\n d.y1 = d.y0 + seenRow;\n d.sprite = sprite.slice(0, (d.y1 - d.y0) * w32);\n }\n}\n\n// Use mask-based collision detection.\nfunction cloudCollide(tag, board, sw) {\n sw >>= 5;\n var sprite = tag.sprite,\n w = tag.width >> 5,\n lx = tag.x - (w << 4),\n sx = lx & 0x7f,\n msx = 32 - sx,\n h = tag.y1 - tag.y0,\n x = (tag.y + tag.y0) * sw + (lx >> 5),\n last;\n for (var j = 0; j < h; j++) {\n last = 0;\n for (var i = 0; i <= w; i++) {\n if (((last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0))\n & board[x + i]) return true;\n }\n x += sw;\n }\n return false;\n}\n\nfunction cloudBounds(bounds, d) {\n var b0 = bounds[0],\n b1 = bounds[1];\n if (d.x + d.x0 < b0.x) b0.x = d.x + d.x0;\n if (d.y + d.y0 < b0.y) b0.y = d.y + d.y0;\n if (d.x + d.x1 > b1.x) b1.x = d.x + d.x1;\n if (d.y + d.y1 > b1.y) b1.y = d.y + d.y1;\n}\n\nfunction collideRects(a, b) {\n return a.x + a.x1 > b[0].x && a.x + a.x0 < b[1].x && a.y + a.y1 > b[0].y && a.y + a.y0 < b[1].y;\n}\n\nfunction archimedeanSpiral(size) {\n var e = size[0] / size[1];\n return function(t) {\n return [e * (t *= .1) * Math.cos(t), t * Math.sin(t)];\n };\n}\n\nfunction rectangularSpiral(size) {\n var dy = 4,\n dx = dy * size[0] / size[1],\n x = 0,\n y = 0;\n return function(t) {\n var sign = t < 0 ? -1 : 1;\n // See triangular numbers: T_n = n * (n + 1) / 2.\n switch ((Math.sqrt(1 + 4 * sign * t) - sign) & 3) {\n case 0: x += dx; break;\n case 1: y += dy; break;\n case 2: x -= dx; break;\n default: y -= dy; break;\n }\n return [x, y];\n };\n}\n\n// TODO reuse arrays?\nfunction zeroArray(n) {\n var a = [],\n i = -1;\n while (++i < n) a[i] = 0;\n return a;\n}\n\nfunction cloudCanvas() {\n return document.createElement(\"canvas\");\n}\n\nfunction functor(d) {\n return typeof d === \"function\" ? d : function() { return d; };\n}\n","import { extent, scaleLinear, select } from 'd3'\nimport cloud from 'd3-cloud'\nimport { debounce } from 'lodash-es'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { Events, ColorClassNameTypes, RenderTypes } from '@/interfaces/enums'\n\nexport class WordCloud extends Component {\n\ttype = 'wordcloud'\n\trenderType = RenderTypes.SVG\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events\n\n\t\t// Highlight correct words on legend item hovers\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\n\t\t// Un-highlight words on legend item mouseouts\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate = true) {\n\t\tconst self = this\n\t\tconst svg = this.getComponentContainer().attr('width', '100%').attr('height', '100%')\n\n\t\tconst displayData = this.model.getDisplayData()\n\t\tconst fontSizeScale = this.getFontSizeScale(displayData)\n\n\t\tconst options = this.getOptions()\n\t\tconst { fontSizeMapsTo, wordMapsTo } = options.wordCloud\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tif (width === 0 || height === 0) {\n\t\t\treturn\n\t\t}\n\n\t\tconst layout = cloud()\n\t\t\t.size([width, height])\n\t\t\t.words(\n\t\t\t\tdisplayData.map(function (d: any) {\n\t\t\t\t\tconst value = d[fontSizeMapsTo]\n\n\t\t\t\t\tif (typeof d[fontSizeMapsTo] !== 'number') {\n\t\t\t\t\t\tthrow Error(\n\t\t\t\t\t\t\t'Badly formatted WordCloud data. `value` should only be an integer or float'\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\t[groupMapsTo]: d[groupMapsTo],\n\t\t\t\t\t\ttext: d[wordMapsTo],\n\t\t\t\t\t\tsize: value,\n\t\t\t\t\t\tvalue\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t)\n\t\t\t.padding(5)\n\t\t\t.rotate(0)\n\t\t\t.fontSize((d: any) => fontSizeScale(d.size))\n\t\t\t.on('end', draw)\n\n\t\tlayout.start()\n\n\t\tfunction draw(words: any) {\n\t\t\tconst textGroup = DOMUtils.appendOrSelect(svg, 'g.words')\n\t\t\ttextGroup.attr('transform', `translate(${layout.size()[0] / 2}, ${layout.size()[1] / 2})`)\n\n\t\t\tconst allText = textGroup\n\t\t\t\t.selectAll('text')\n\t\t\t\t.data(words, (d: any) => `${d[groupMapsTo]}-${d.text}`)\n\n\t\t\t// Remove texts that are no longer needed\n\t\t\tallText.exit().attr('opacity', 0).remove()\n\n\t\t\tconst enteringText = allText.enter().append('text').attr('opacity', 0)\n\n\t\t\tenteringText\n\t\t\t\t.merge(allText as any)\n\t\t\t\t.style('font-size', (d: any) => `${d.size}px`)\n\t\t\t\t.text(function (d: any) {\n\t\t\t\t\treturn d.text\n\t\t\t\t})\n\t\t\t\t.attr('class', (d: any) =>\n\t\t\t\t\tself.model.getColorClassName({\n\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\t\toriginalClassName: `word ${d.size > 32 ? 'light' : ''}`\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.style('fill', (d: any) => {\n\t\t\t\t\treturn self.model.getFillColor(d[groupMapsTo], d.text, d)\n\t\t\t\t})\n\t\t\t\t.attr('text-anchor', 'middle')\n\t\t\t\t.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'wordcloud-text-update-enter',\n\t\t\t\t\t\tanimate\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.attr('transform', (d: any) => `translate(${d.x}, ${d.y})`)\n\t\t\t\t.attr('opacity', 1)\n\t\t}\n\n\t\t// Add event listeners\n\t\tthis.addEventListeners()\n\t}\n\n\tgetFontSizeScale(data: any) {\n\t\tconst options = this.getOptions()\n\t\tconst { fontSizeMapsTo } = options.wordCloud\n\n\t\t// Filter out any null/undefined values\n\t\tconst allOccurences = data.map((d: any) => d[fontSizeMapsTo]).filter((size: any) => size)\n\t\tconst chartSize = DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer())\n\n\t\t// We need the ternary operator here in case the user\n\t\t// doesn't provide size values in data\n\t\tconst sizeDataIsValid = allOccurences.length > 0\n\t\tconst domain = sizeDataIsValid ? extent(allOccurences) : [1, 1]\n\n\t\treturn scaleLinear()\n\t\t\t.domain(domain as any)\n\t\t\t.range(sizeDataIsValid ? options.wordCloud.fontSizeRange(chartSize, data) : [4, 4])\n\t}\n\n\t// Highlight elements that match the hovered legend item\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\t\tconst { groupMapsTo } = this.getOptions().data\n\n\t\tthis.parent\n\t\t\t.selectAll('text.word')\n\t\t\t.transition('legend-hover-wordcloud')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-wordcloud'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => (d[groupMapsTo] !== hoveredElement.datum()['name'] ? 0.3 : 1))\n\t}\n\n\t// Un-highlight all elements\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('text.word')\n\t\t\t.transition('legend-mouseout-wordcloud')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-wordcloud'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\taddEventListeners() {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst self = this\n\n\t\t// Highlights 1 word or unhighlights all\n\t\tconst debouncedHighlight = debounce((word: any) => {\n\t\t\tconst allWords = self.parent\n\t\t\t\t.selectAll('text.word')\n\t\t\t\t.transition('wordcloud-word-mouse-highlight')\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'wordcloud-word-mouse-highlight'\n\t\t\t\t\t})\n\t\t\t\t)\n\n\t\t\tif (word === null) {\n\t\t\t\tallWords.attr('opacity', 1)\n\t\t\t} else {\n\t\t\t\tallWords.attr('opacity', function () {\n\t\t\t\t\tif (word === this) {\n\t\t\t\t\t\treturn 1\n\t\t\t\t\t}\n\n\t\t\t\t\treturn 0.3\n\t\t\t\t})\n\t\t\t}\n\t\t}, 6)\n\n\t\tthis.parent\n\t\t\t.selectAll('text.word')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = this\n\t\t\t\tdebouncedHighlight(hoveredElement)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.WordCloud.WORD_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: options.tooltip.wordLabel,\n\t\t\t\t\t\t\tvalue: datum.text\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: options.tooltip.valueLabel,\n\t\t\t\t\t\t\tvalue: datum.value\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: options.tooltip.groupLabel,\n\t\t\t\t\t\t\tvalue: datum[groupMapsTo],\n\t\t\t\t\t\t\tclass: self.model.getColorClassName({\n\t\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.TOOLTIP],\n\t\t\t\t\t\t\t\tdataGroupName: datum[groupMapsTo]\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.WordCloud.WORD_MOUSEMOVE, {\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.WordCloud.WORD_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\tdebouncedHighlight(null)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.WordCloud.WORD_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n","import {\n\tgeoPath,\n\tline,\n\t// Azimuthal Projections - project the sphere directly on to the plane\n\tgeoEqualEarth,\n\t// Conic projections - project the sphere onto a cone & unroll into the plane\n\tgeoAlbers,\n\tgeoConicEqualArea,\n\tgeoConicEquidistant,\n\t// Cylindrical projections - project the sphere onto a containing cylinder & unroll onto the plane\n\tgeoEquirectangular,\n\tgeoMercator,\n\tgeoNaturalEarth1\n} from 'd3'\nimport { feature, merge } from 'topojson-client'\nimport type { GeometryObject } from 'topojson-specification'\nimport { Component } from '@/components'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { getProperty } from '@/tools'\nimport { RenderTypes, Projection } from '@/interfaces/enums'\nimport { ChoroplethModel } from '@/model'\n\nexport class GeoProjection extends Component {\n\ttype = 'geo'\n\trenderType = RenderTypes.SVG\n\n\trender() {\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true })\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\t// Because of a Firefox bug with regard to sizing & d3 packs,\n\t\t// rather than checking if height or width aren't 0,\n\t\t// we have to make sure they're not smaller than 1\n\t\tif (width < 1 || height < 1) {\n\t\t\treturn\n\t\t}\n\n\t\t// Get users projection\n\t\tconst projection = this.getProjection()\n\n\t\tconst geoData = getProperty(this.getOptions(), 'geoData')\n\n\t\tconst data = (this.model as ChoroplethModel).getCombinedData()\n\n\t\t// Separate countries that have data & countries with missing data\n\t\tconst withData = {}\n\t\tconst withoutData = {}\n\t\tObject.keys(data).forEach(element => {\n\t\t\tif (typeof data[element].value === 'number') {\n\t\t\t\twithData[element] = data[element]\n\t\t\t} else {\n\t\t\t\twithoutData[element] = data[element]\n\t\t\t}\n\t\t})\n\n\t\t// Merge all without data\n\t\tconst withoutDataMerge = merge(geoData, Object.values(withoutData))\n\n\t\t/**\n\t\t * @todo - Currently only topojson is supported\n\t\t *\n\t\t * Unlike geojson, topojson does not have a standard format\n\t\t * So data must be nested in the following format:\n\t\t * options : {\n\t\t * \tgeoData: {\n\t\t * \tobjects: {\n\t\t * \t\t\t...\n\t\t * \t\t}\n\t\t * }\n\t\t * }\n\t\t */\n\t\t// Convert from topojson to geojson\n\t\tconst json = feature(geoData, {\n\t\t\t// We need to specify that we are converting geometry collections\n\t\t\ttype: 'GeometryCollection',\n\t\t\tgeometries: Object.values(withData) as GeometryObject<{ [name: string]: any }>[]\n\t\t})\n\n\t\t// Depending on the projection selected, we will need to scale/translate accordingly\n\t\tconst projectionScale = projection.fitSize([width, height], json)\n\t\tconst geo = geoPath().projection(projectionScale)\n\n\t\tconst borders = DOMUtils.appendOrSelect(svg, 'g.geo')\n\t\tborders.selectAll('path').data(json.features).join('path').attr('d', geo)\n\n\t\tconst patternID = this.services.domUtils.generateElementIDString(`geo-pattern-stripes`)\n\n\t\t// Create a striped pattern for missing data\n\t\tconst defs = DOMUtils.appendOrSelect(svg, 'defs')\n\t\tDOMUtils.appendOrSelect(defs, 'pattern')\n\t\t\t.attr('id', patternID)\n\t\t\t.attr('width', 5)\n\t\t\t.attr('height', 10)\n\t\t\t.attr('patternUnits', 'userSpaceOnUse')\n\t\t\t.attr('patternTransform', 'rotate(45)')\n\t\t\t.append('path')\n\t\t\t.classed('pattern-fill', true)\n\t\t\t.attr(\n\t\t\t\t'd',\n\t\t\t\tline()([\n\t\t\t\t\t[0, 0],\n\t\t\t\t\t[0, 10]\n\t\t\t\t])\n\t\t\t)\n\n\t\tconst missingBorders = DOMUtils.appendOrSelect(svg, 'g.missing-data')\n\t\tDOMUtils.appendOrSelect(missingBorders, 'path')\n\t\t\t.datum(withoutDataMerge)\n\t\t\t.attr('d', geo)\n\t\t\t.style('fill', `url(#${patternID})`)\n\t}\n\n\t/**\n\t * @info\n\t * Depending on projection, we may need to provide additional configuration\n\t * e.g. sizing\n\t *\n\t * In such case, function can be refactored so that\n\t * projection should return an object with the configuraiton & function\n\t */\n\tgetProjection() {\n\t\tlet projection = null\n\t\tconst projectionSelected = getProperty(this.getOptions(), 'thematic', 'projection')\n\n\t\tswitch (projectionSelected) {\n\t\t\t// Azimuthal Projections\n\t\t\tcase Projection.geoEqualEarth:\n\t\t\t\tprojection = geoEqualEarth()\n\t\t\t\tbreak\n\t\t\t// Conic Projections\n\t\t\tcase Projection.geoAlbers:\n\t\t\t\tprojection = geoAlbers()\n\t\t\t\tbreak\n\t\t\tcase Projection.geoConicEqualArea:\n\t\t\t\tprojection = geoConicEqualArea()\n\t\t\t\tbreak\n\t\t\tcase Projection.geoConicEquidistant:\n\t\t\t\tprojection = geoConicEquidistant()\n\t\t\t\tbreak\n\t\t\t// Cyndrical projections\n\t\t\tcase Projection.geoEquirectangular:\n\t\t\t\tprojection = geoEquirectangular()\n\t\t\t\tbreak\n\t\t\tcase Projection.geoMercator:\n\t\t\t\tprojection = geoMercator()\n\t\t\t\tbreak\n\t\t\tcase Projection.geoNaturalEarth1:\n\t\t\t\tprojection = geoNaturalEarth1()\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\t// Projection is missing or an unsupported projection value is passed\n\t\t\t\tthrow new Error('Projection is not supported.')\n\t\t\t\tbreak\n\t\t}\n\n\t\treturn projection\n\t}\n}\n","import { select } from 'd3'\nimport * as Events from '@/interfaces/events'\nimport { GeoProjection } from '@/components/essentials/geo-projection'\nimport { ChoroplethModel } from '@/model'\n\nexport class Choropleth extends GeoProjection {\n\ttype = 'choropleth'\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\tsuper.render()\n\t\tconst data = (this.model as ChoroplethModel).getCombinedData()\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true })\n\n\t\tconst geo = svg.select('g.geo')\n\t\tgeo\n\t\t\t.selectAll('path')\n\t\t\t.classed('border', true)\n\t\t\t.attr('class', (d: any) => {\n\t\t\t\treturn this.model.getColorClassName({\n\t\t\t\t\tvalue: data[d.properties.NAME].value,\n\t\t\t\t\toriginalClassName: `border`\n\t\t\t\t})\n\t\t\t})\n\n\t\tthis.addCountryAreaEventListener()\n\t}\n\n\taddCountryAreaEventListener() {\n\t\tconst self = this\n\t\tconst data = (this.model as ChoroplethModel).getCombinedData()\n\n\t\tthis.parent\n\t\t\t.selectAll('path.border')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse over event\n\t\t\t\tself.services.events.dispatchEvent(Events.Choropleth.CHOROPLETH_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum: data[datum.properties.NAME]\n\t\t\t\t})\n\n\t\t\t\t// Dispatch tooltip show event\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: datum.properties.NAME,\n\t\t\t\t\t\t\tvalue: data[datum.properties.NAME].value\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse move event\n\t\t\t\tself.services.events.dispatchEvent(Events.Choropleth.CHOROPLETH_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum: data[datum.properties.NAME]\n\t\t\t\t})\n\t\t\t\t// Dispatch tooltip move event\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse click event\n\t\t\t\tself.services.events.dispatchEvent(Events.Choropleth.CHOROPLETH_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum: data[datum.properties.NAME]\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse out event\n\t\t\t\tself.services.events.dispatchEvent(Events.Choropleth.CHOROPLETH_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum: data[datum.properties.NAME]\n\t\t\t\t})\n\n\t\t\t\t// Dispatch hide tooltip event\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n","import { Chart } from '@/chart'\nimport { options as configOptions } from '@/configuration'\nimport { getProperty, mergeDefaultChartOptions } from '@/tools'\nimport { ChoroplethModel } from '@/model/choropleth'\nimport type { ChoroplethChartOptions } from '@/interfaces/charts'\nimport type { ChartConfig } from '@/interfaces/model'\nimport { LayoutDirection, LayoutGrowth, RenderTypes, LayoutAlignItems } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Choropleth } from '@/components/graphs/choropleth'\nimport { Modal } from '@/components/essentials/modal'\nimport { LayoutComponent } from '@/components/layout/layout'\nimport { ColorScaleLegend } from '@/components/essentials/color-scale-legend'\nimport { Title } from '@/components/essentials/title'\nimport { Spacer } from '@/components/layout/spacer'\nimport { Toolbar } from '@/components/axes/toolbar'\nimport { Tooltip } from '@/components/essentials/tooltip'\n\nexport class ExperimentalChoroplethChart extends Chart {\n\tmodel = new ChoroplethModel(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<ChoroplethChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(\n\t\t\tmergeDefaultChartOptions(configOptions.choroplethChart, chartConfigs.options)\n\t\t)\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t// Custom getChartComponents - Implements getChartComponents\n\t// Removes zoombar support and additional `features` that are not supported in heatmap\n\tprotected getChartComponents(graphFrameComponents: any[], configs?: any) {\n\t\tconst options = this.model.getOptions()\n\t\tconst toolbarEnabled = getProperty(options, 'toolbar', 'enabled')\n\n\t\tconst titleAvailable = !!this.model.getOptions().title\n\t\tconst titleComponent = {\n\t\t\tid: 'title',\n\t\t\tcomponents: [new Title(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.STRETCH\n\t\t}\n\n\t\tconst toolbarComponent = {\n\t\t\tid: 'toolbar',\n\t\t\tcomponents: [new Toolbar(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst headerComponent = {\n\t\t\tid: 'header',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t// always add title to keep layout correct\n\t\t\t\t\t\ttitleComponent,\n\t\t\t\t\t\t...(toolbarEnabled ? [toolbarComponent] : [])\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: LayoutDirection.ROW,\n\t\t\t\t\t\talignItems: LayoutAlignItems.CENTER\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst legendComponent = {\n\t\t\tid: 'legend',\n\t\t\tcomponents: [\n\t\t\t\tnew ColorScaleLegend(this.model, this.services, {\n\t\t\t\t\tchartType: 'choropleth'\n\t\t\t\t})\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t\trenderType: RenderTypes.SVG\n\t\t}\n\n\t\tconst graphFrameComponent = {\n\t\t\tid: 'graph-frame',\n\t\t\tcomponents: graphFrameComponents,\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t\trenderType: RenderTypes.SVG\n\t\t}\n\n\t\tconst isLegendEnabled =\n\t\t\tgetProperty(configs, 'legend', 'enabled') !== false &&\n\t\t\tthis.model.getOptions().legend.enabled !== false\n\n\t\t// Decide the position of the legend in reference to the chart\n\t\tconst fullFrameComponentDirection = LayoutDirection.COLUMN_REVERSE\n\n\t\tconst legendSpacerComponent = {\n\t\t\tid: 'spacer',\n\t\t\tcomponents: [new Spacer(this.model, this.services, { size: 15 })],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst fullFrameComponent = {\n\t\t\tid: 'full-frame',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t...(isLegendEnabled ? [legendComponent] : []),\n\t\t\t\t\t\t...(isLegendEnabled ? [legendSpacerComponent] : []),\n\t\t\t\t\t\tgraphFrameComponent\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: fullFrameComponentDirection\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.STRETCH\n\t\t}\n\n\t\tconst topLevelLayoutComponents = []\n\t\t// header component is required for either title or toolbar\n\t\tif (titleAvailable || toolbarEnabled) {\n\t\t\ttopLevelLayoutComponents.push(headerComponent)\n\n\t\t\tconst titleSpacerComponent = {\n\t\t\t\tid: 'spacer',\n\t\t\t\tcomponents: [\n\t\t\t\t\tnew Spacer(this.model, this.services, toolbarEnabled ? { size: 15 } : undefined)\n\t\t\t\t],\n\t\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t\t}\n\n\t\t\ttopLevelLayoutComponents.push(titleSpacerComponent)\n\t\t}\n\t\ttopLevelLayoutComponents.push(fullFrameComponent)\n\n\t\treturn [\n\t\t\tnew Tooltip(this.model, this.services),\n\t\t\tnew Modal(this.model, this.services),\n\t\t\tnew LayoutComponent(this.model, this.services, topLevelLayoutComponents, {\n\t\t\t\tdirection: LayoutDirection.COLUMN\n\t\t\t})\n\t\t]\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [new Choropleth(this.model, this.services)]\n\n\t\tconst components: Component[] = this.getChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { merge } from 'lodash-es'\nimport { getProperty, updateLegendAdditionalItems } from '@/tools'\nimport { ChartModel } from './model'\nimport { LegendItemType } from '@/interfaces/enums'\n\n/** The charting model layer which includes mainly the chart data and options,\n * as well as some misc. information to be shared among components */\nexport class CirclePackChartModel extends ChartModel {\n\tparentNode = false\n\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t\tthis.set({ depth: 2 }, { skipUpdate: true })\n\t}\n\n\tsetData(newData: any) {\n\t\tsuper.setData(newData)\n\t\tthis.setDataGroups()\n\t\tif (newData.length === 1) {\n\t\t\tthis.parentNode = true\n\t\t}\n\t\tthis.setZoom()\n\t}\n\n\tsetOptions(newOptions: any) {\n\t\tconst options = this.getOptions()\n\t\tconst zoomOptions = merge({}, newOptions, this.getZoomOptions(newOptions))\n\t\tupdateLegendAdditionalItems(options, zoomOptions)\n\n\t\tconst depth = this.getHierarchyLevel()\n\t\tconst userProvidedDepth = getProperty(options, 'circlePack', 'hierarchyLevel')\n\n\t\tthis.set({\n\t\t\toptions: merge(options, zoomOptions),\n\t\t\tdepth: userProvidedDepth && userProvidedDepth < 4 ? userProvidedDepth : depth\n\t\t})\n\t}\n\n\tgetZoomOptions(options?: any) {\n\t\tif (!this.getDisplayData()) {\n\t\t\treturn {}\n\t\t}\n\t\t// uses the user provided options and data to determine if there is zoom in this CP chart\n\t\tconst displayData = this.getDisplayData()\n\t\tconst zoomOptions = options ? options : this.getOptions()\n\t\tconst data =\n\t\t\tdisplayData.length === 1 && getProperty(displayData, 0, 'children')\n\t\t\t\t? getProperty(displayData, 0, 'children')\n\t\t\t\t: displayData\n\n\t\tlet depth = this.getHierarchyLevel()\n\t\t// check the data depth\n\t\tdata.some((datum: any) => {\n\t\t\tif (datum.children) {\n\t\t\t\tif (datum.children.some((item: any) => item.children)) {\n\t\t\t\t\tdepth = 3\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\tif (getProperty(zoomOptions, 'canvasZoom', 'enabled') === true && depth > 2) {\n\t\t\treturn {\n\t\t\t\tlegend: {\n\t\t\t\t\tadditionalItems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: LegendItemType.ZOOM,\n\t\t\t\t\t\t\tname: 'Click to zoom'\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null\n\t}\n\n\tsetZoom(options?: any) {\n\t\tthis.setOptions(this.getZoomOptions(options))\n\t}\n\n\t// update the hierarchy level\n\tupdateHierarchyLevel(depth: number) {\n\t\tthis.set({ depth: depth })\n\t}\n\n\tgetHierarchyLevel() {\n\t\treturn this.get('depth')\n\t}\n\n\thasParentNode() {\n\t\treturn this.parentNode\n\t}\n\n\t// set the datagroup name on the items that are it's children\n\tsetDataGroups() {\n\t\tconst data = this.getData()\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst newData = data.map((depthOne: any) => {\n\t\t\tconst groupName = depthOne[groupMapsTo]\n\t\t\treturn this.setChildrenDataGroup(depthOne, groupName)\n\t\t})\n\n\t\tthis.set(\n\t\t\t{\n\t\t\t\tdata: newData\n\t\t\t},\n\t\t\t{ skipUpdate: true }\n\t\t)\n\t}\n\n\t// sets name recursively down the node tree\n\tprotected setChildrenDataGroup(node: any, name: any) {\n\t\tif (node.children) {\n\t\t\treturn {\n\t\t\t\t...node,\n\t\t\t\tdataGroupName: name,\n\t\t\t\tchildren: node.children.map((child: any) => {\n\t\t\t\t\treturn this.setChildrenDataGroup(child, name)\n\t\t\t\t})\n\t\t\t}\n\t\t} else {\n\t\t\treturn { ...node, dataGroupName: name }\n\t\t}\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\n\t\tconst headers = ['Child', 'Parent', 'Value']\n\t\tconst cells = []\n\n\t\tdisplayData.forEach((datum: any) => {\n\t\t\tlet value = datum.value ? datum.value : 0\n\t\t\tif (datum.children) {\n\t\t\t\t// Call recursive function\n\t\t\t\tvalue += this.getChildrenDatums(datum.children, datum.name, cells, 0)\n\t\t\t}\n\t\t\tcells.push(['–', datum.name, value])\n\t\t})\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n\n\t/**\n\t * Recursively determine the relationship between all the nested elements in the child\n\t * @param children: Object\n\t * @param parent: String\n\t * @param result: Array<Object>\n\t * @param totalSum: number\n\t * @returns: number\n\t */\n\tprivate getChildrenDatums(children: any, parent: any, result: string[][] = [], totalSum = 0) {\n\t\tconst grandParent = parent\n\n\t\tchildren.forEach((child: any) => {\n\t\t\tconst parentWithinIteration = child.name\n\t\t\tlet sum = 0\n\n\t\t\tif (child.children) {\n\t\t\t\tif (child.children.length > 0) {\n\t\t\t\t\tif (typeof child.value === 'number') {\n\t\t\t\t\t\ttotalSum += child.value\n\t\t\t\t\t}\n\n\t\t\t\t\tsum += this.getChildrenDatums(child.children, parentWithinIteration, result, sum)\n\t\t\t\t\tresult.push([parentWithinIteration, grandParent, sum])\n\t\t\t\t\ttotalSum += sum\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlet value = 0\n\t\t\t\tif (typeof child.value === 'number') {\n\t\t\t\t\tvalue = child.value\n\t\t\t\t\ttotalSum += child.value\n\t\t\t\t}\n\t\t\t\tresult.push([child.name, grandParent, value])\n\t\t\t}\n\t\t})\n\n\t\treturn totalSum\n\t}\n}\n","import { Chart } from '@/chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport { CirclePackChartModel } from '@/model/circle-pack'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { CirclePackChartOptions } from '@/interfaces/charts'\nimport type { Component } from '@/components/component'\nimport { CirclePack } from '@/components/graphs/circle-pack'\n\nexport class CirclePackChart extends Chart {\n\tmodel = new CirclePackChartModel(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<CirclePackChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.circlePackChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [new CirclePack(this.model, this.services)]\n\n\t\t// get the base chart components and export with tooltip\n\t\tconst components: Component[] = this.getChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { camelCase, flatten, merge } from 'lodash-es'\nimport { AxisChart } from '@/axis-chart'\nimport { options as configOptions } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { ChartConfig } from '@/interfaces/model'\nimport { ChartTypes, Skeletons } from '@/interfaces/enums'\nimport type { ComboChartOptions } from '@/interfaces/charts'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { Line } from '@/components/graphs/line'\nimport { Skeleton } from '@/components/graphs/skeleton'\nimport { SimpleBar } from '@/components/graphs/bar-simple'\nimport { GroupedBar } from '@/components/graphs/bar-grouped'\nimport { StackedRuler } from '@/components/axes/ruler-stacked'\nimport { Area } from '@/components/graphs/area'\nimport { Ruler } from '@/components/axes/ruler'\nimport { Scatter } from '@/components/graphs/scatter'\nimport { ZeroLine } from '@/components/axes/zero-line'\nimport { StackedArea } from '@/components/graphs/area-stacked'\nimport { StackedBar } from '@/components/graphs/bar-stacked'\nimport { StackedScatter } from '@/components/graphs/scatter-stacked'\n\nconst graphComponentsMap = {\n\t[ChartTypes.LINE]: [Line, Scatter],\n\t[ChartTypes.SCATTER]: [Scatter],\n\t[ChartTypes.AREA]: [Area, Line, Scatter],\n\t[ChartTypes.STACKED_AREA]: [StackedArea, Line, StackedScatter, StackedRuler],\n\t[ChartTypes.SIMPLE_BAR]: [SimpleBar],\n\t[ChartTypes.GROUPED_BAR]: [GroupedBar, ZeroLine],\n\t[ChartTypes.STACKED_BAR]: [StackedBar, StackedRuler]\n}\n\nexport class ComboChart extends AxisChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<ComboChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tconst chartOptions = mergeDefaultChartOptions(configOptions.comboChart, chartConfigs.options)\n\n\t\t// Warn user if no comboChartTypes defined\n\t\t// Use skeleton chart instead\n\t\tif (!chartConfigs.options.comboChartTypes) {\n\t\t\tconsole.error('No comboChartTypes defined for the Combo Chart!')\n\t\t\t// add a default chart to get an empty chart\n\t\t\tchartOptions.comboChartTypes = [{ type: ChartTypes.LINE, correspondingDatasets: [] }]\n\t\t}\n\n\t\t// set the global options\n\t\tthis.model.setOptions(chartOptions)\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetGraphComponents() {\n\t\tconst { comboChartTypes }: { comboChartTypes: Component[] } = this.model.getOptions()\n\t\tlet counter = 0\n\t\tconst graphComponents: Component[] = comboChartTypes\n\t\t\t.map((graph: any) => {\n\t\t\t\tconst type = graph.type\n\t\t\t\tlet options: any\n\n\t\t\t\t// initializes the components using input strings with the base configs for each chart\n\t\t\t\tif (typeof graph.type === 'string') {\n\t\t\t\t\t// check if it is in the components map\n\t\t\t\t\t// if it isn't then it is not a valid carbon chart to use in combo\n\t\t\t\t\tif (!Object.keys(graphComponentsMap).includes(graph.type)) {\n\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t`Invalid chart type \"${graph.type}\" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`\n\t\t\t\t\t\t)\n\t\t\t\t\t\treturn null\n\t\t\t\t\t}\n\t\t\t\t\tlet stacked = false\n\t\t\t\t\tconst key = `${camelCase(graph.type)}Chart` as keyof typeof configOptions\n\t\t\t\t\toptions = merge({}, configOptions[key], this.model.getOptions(), graph.options)\n\t\t\t\t\t// if we are creating a stacked area, the contained Line chart needs to know it is stacked\n\t\t\t\t\tif (graph.type === ChartTypes.STACKED_AREA) {\n\t\t\t\t\t\tstacked = true\n\t\t\t\t\t}\n\t\t\t\t\treturn graphComponentsMap[graph.type as keyof typeof graphComponentsMap].map(\n\t\t\t\t\t\t(Component: any) =>\n\t\t\t\t\t\t\tnew Component(this.model, this.services, {\n\t\t\t\t\t\t\t\tgroups: graph.correspondingDatasets,\n\t\t\t\t\t\t\t\tid: counter++,\n\t\t\t\t\t\t\t\toptions: options,\n\t\t\t\t\t\t\t\tstacked\n\t\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t} else {\n\t\t\t\t\t// user has imported a type or custom component to instantiate\n\t\t\t\t\toptions = merge({}, this.model.getOptions(), graph.options)\n\t\t\t\t\treturn new type(this.model, this.services, {\n\t\t\t\t\t\tgroups: graph.correspondingDatasets,\n\t\t\t\t\t\tid: counter++,\n\t\t\t\t\t\toptions: options\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\t.filter((item: any) => item !== null)\n\n\t\treturn flatten(graphComponents)\n\t}\n\n\tgetComponents() {\n\t\tconst { comboChartTypes } = this.model.getOptions()\n\t\t// don't add the regular ruler if stacked ruler is added\n\t\tconst stackedRulerEnabled = comboChartTypes.some(\n\t\t\t(chartObject: any) =>\n\t\t\t\tchartObject.type === ChartTypes.STACKED_BAR || chartObject.type === ChartTypes.STACKED_AREA\n\t\t)\n\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.GRID\n\t\t\t}),\n\t\t\t...(stackedRulerEnabled ? [] : [new Ruler(this.model, this.services)]),\n\t\t\t...this.getGraphComponents()\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\n\t\treturn components\n\t}\n}\n","import { ChartModel } from './model'\n\n/** The charting model layer which includes mainly the chart data and options,\n * as well as some misc. information to be shared among components */\nexport class PieChartModel extends ChartModel {\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\tgetTabularData(data: any) {\n\t\tconst tabularData = super.getTabularData(data)\n\n\t\t// if the data was changed to tabular format\n\t\t// update the group to the key so the slices render with the correct tooltips and colors\n\t\tif (data !== tabularData) {\n\t\t\t// If a label was set for the overall dataset, reassign it to key value\n\t\t\ttabularData.forEach((d: any) => {\n\t\t\t\tif (d.key && d.key !== d.group) {\n\t\t\t\t\td.group = d.key\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\treturn tabularData\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst { valueMapsTo } = options.pie\n\n\t\tconst headers = ['Group', 'Value']\n\t\tconst cells = [\n\t\t\t...displayData.map((datum: any) => [\n\t\t\t\tdatum[groupMapsTo],\n\t\t\t\tdatum[valueMapsTo] === null ? '–' : datum[valueMapsTo].toLocaleString()\n\t\t\t])\n\t\t]\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n\n\tsanitize(data: any) {\n\t\tconst tabularData = this.getTabularData(data)\n\n\t\t// Sort data based on value\n\t\treturn tabularData.sort((a, b) => b.value - a.value)\n\t}\n}\n","import { Chart } from '@/chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport { PieChartModel } from '@/model/pie'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { PieChartOptions } from '@/interfaces/charts'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Pie } from '@/components/graphs/pie'\nimport { Skeleton } from '@/components/graphs/skeleton'\n\nexport class PieChart extends Chart {\n\tmodel = new PieChartModel(this.services)\n\n\t// TODO - Optimize the use of \"extending\"\n\tconstructor(\n\t\tholder: HTMLDivElement,\n\t\tchartConfigs: ChartConfig<PieChartOptions>,\n\t\textending = false\n\t) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// TODO - Optimize the use of \"extending\"\n\t\tif (extending) {\n\t\t\treturn\n\t\t}\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.pieChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew Pie(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.PIE\n\t\t\t})\n\t\t]\n\n\t\t// get the base chart components and export with tooltip\n\t\tconst components: Component[] = this.getChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { PieChart } from './pie'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { PieChartOptions } from '@/interfaces/charts'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Donut } from '@/components/graphs/donut'\nimport { Skeleton } from '@/components/graphs/skeleton'\n\nexport class DonutChart extends PieChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<PieChartOptions>) {\n\t\tsuper(holder, chartConfigs, true)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.donutChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew Donut(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.DONUT\n\t\t\t})\n\t\t]\n\n\t\tconst components: Component[] = this.getChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { ChartModel } from './model'\n\n/**\n * The gauge chart model layer\n */\nexport class GaugeChartModel extends ChartModel {\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\tgetDataGroups() {\n\t\treturn super.getDataGroups().filter((item: any) => item.name !== 'delta')\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst headers = ['Group', 'Value']\n\t\tconst cells = [\n\t\t\t...displayData.map((datum: any) => [\n\t\t\t\tdatum[groupMapsTo],\n\t\t\t\tdatum['value'] === null ? '–' : datum['value'].toLocaleString()\n\t\t\t])\n\t\t]\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n}\n","import { Chart } from '@/chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { GaugeChartOptions } from '@/interfaces/charts'\nimport { GaugeChartModel } from '@/model/gauge'\nimport type { Component } from '@/components/component'\nimport { Gauge } from '@/components/graphs/gauge'\n\nexport class GaugeChart extends Chart {\n\tmodel = new GaugeChartModel(this.services)\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<GaugeChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.gaugeChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [new Gauge(this.model, this.services)]\n\n\t\tconst components: Component[] = this.getChartComponents(graphFrameComponents)\n\n\t\treturn components\n\t}\n}\n","import { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { BarChartOptions } from '@/interfaces/charts'\nimport type { ChartConfig } from '@/interfaces/model'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { ZeroLine } from '@/components/axes/zero-line'\nimport { Skeleton } from '@/components/graphs/skeleton'\nimport { GroupedBar } from '@/components/graphs/bar-grouped'\n\nexport class GroupedBarChart extends AxisChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<BarChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.groupedBarChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew GroupedBar(this.model, this.services),\n\t\t\tnew ZeroLine(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.VERT_OR_HORIZ\n\t\t\t})\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { extent, scaleQuantize, scaleLinear } from 'd3'\nimport { cloneDeep, isEmpty } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { AxisFlavor, ScaleTypes } from '@/interfaces/enums'\nimport { getColorScale } from '@/services'\nimport { ChartModelCartesian } from './cartesian-charts'\n\n/** The gauge chart model layer */\nexport class HeatmapModel extends ChartModelCartesian {\n\taxisFlavor = AxisFlavor.HOVERABLE\n\tprivate _colorScale: any = undefined\n\n\t// List of unique ranges and domains\n\tprivate _domains: any[] = []\n\tprivate _ranges: any[] = []\n\n\tprivate _matrix: any = {}\n\n\tconstructor(services: any) {\n\t\tsuper(services)\n\n\t\t// Check which scale types are being used\n\t\tconst axis = getProperty(this.getOptions(), 'axes')\n\n\t\t// Need to check options since scale service hasn't been instantiated\n\t\tif (\n\t\t\t(!!getProperty(axis, 'left', 'scaleType') &&\n\t\t\t\tgetProperty(axis, 'left', 'scaleType') !== ScaleTypes.LABELS) ||\n\t\t\t(!!getProperty(axis, 'right', 'scaleType') &&\n\t\t\t\tgetProperty(axis, 'right', 'scaleType') !== ScaleTypes.LABELS) ||\n\t\t\t(!!getProperty(axis, 'top', 'scaleType') &&\n\t\t\t\tgetProperty(axis, 'top', 'scaleType') !== ScaleTypes.LABELS) ||\n\t\t\t(!!getProperty(axis, 'bottom', 'scaleType') &&\n\t\t\t\tgetProperty(axis, 'bottom', 'scaleType') !== ScaleTypes.LABELS)\n\t\t) {\n\t\t\tthrow Error('Heatmap only supports label scaletypes.')\n\t\t}\n\t}\n\n\t/**\n\t * Get min and maximum value of the display data\n\t * @returns Array consisting of smallest and largest values in data\n\t */\n\tgetValueDomain() {\n\t\tconst limits = extent(this.getDisplayData(), (d: any) => d.value)\n\t\tconst domain = scaleLinear()\n\t\t\t.domain(limits as [number, number])\n\t\t\t.nice()\n\t\t\t.domain()\n\n\t\t// Ensuring limits start at 0 to make scale look more `nicer`\n\t\tif (domain[0] > 0) {\n\t\t\tdomain[0] = 0\n\t\t} else if (domain[0] === 0 && domain[1] === 0) {\n\t\t\t// Range cannot be between 0 and 0 (itself)\n\t\t\treturn [0, 1]\n\t\t}\n\n\t\t// Ensure the median of the range is 0 if domain extends into both negative & positive\n\t\tif (domain[0] < 0 && domain[1] > 0) {\n\t\t\tif (Math.abs(domain[0]) > domain[1]) {\n\t\t\t\tdomain[1] = Math.abs(domain[0])\n\t\t\t} else {\n\t\t\t\tdomain[0] = -domain[1]\n\t\t\t}\n\t\t}\n\n\t\treturn domain\n\t}\n\n\t/**\n\t * @override\n\t * @param value\n\t * @returns string\n\t */\n\tgetFillColor(value: number) {\n\t\treturn this._colorScale(value)\n\t}\n\n\t/**\n\t * Generate a list of all unique domains\n\t * @returns String[]\n\t */\n\tgetUniqueDomain(): string[] {\n\t\tif (isEmpty(this._domains)) {\n\t\t\tconst displayData = this.getDisplayData()\n\t\t\tconst { cartesianScales } = this.services\n\n\t\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier()\n\t\t\tconst mainXAxisPosition = cartesianScales.getMainXAxisPosition()\n\t\t\tconst customDomain = cartesianScales.getCustomDomainValuesByposition(mainXAxisPosition)\n\n\t\t\t// Use user defined domain if specified\n\t\t\tif (customDomain) {\n\t\t\t\treturn customDomain\n\t\t\t}\n\n\t\t\t// Get unique axis values & create a matrix\n\t\t\tthis._domains = Array.from(\n\t\t\t\tnew Set(\n\t\t\t\t\tdisplayData.map((d: any) => {\n\t\t\t\t\t\treturn d[domainIdentifier]\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t)\n\t\t}\n\n\t\treturn this._domains\n\t}\n\n\t/**\n\t * Generates a list of all unique ranges\n\t * @returns String[]\n\t */\n\tgetUniqueRanges(): string[] {\n\t\tif (isEmpty(this._ranges)) {\n\t\t\tconst displayData = this.getDisplayData()\n\t\t\tconst { cartesianScales } = this.services\n\n\t\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier()\n\t\t\tconst mainYAxisPosition = cartesianScales.getMainYAxisPosition()\n\t\t\tconst customDomain = cartesianScales.getCustomDomainValuesByposition(mainYAxisPosition)\n\n\t\t\t// Use user defined domain if specified\n\t\t\tif (customDomain) {\n\t\t\t\treturn customDomain\n\t\t\t}\n\n\t\t\t// Get unique axis values & create a matrix\n\t\t\tthis._ranges = Array.from(\n\t\t\t\tnew Set(\n\t\t\t\t\tdisplayData.map((d: any) => {\n\t\t\t\t\t\treturn d[rangeIdentifier]\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t)\n\t\t}\n\n\t\treturn this._ranges\n\t}\n\n\t/**\n\t * Generates a matrix (If doesn't exist) and returns it\n\t * @returns Object\n\t */\n\tgetMatrix() {\n\t\tif (isEmpty(this._matrix)) {\n\t\t\tconst uniqueDomain = this.getUniqueDomain()\n\t\t\tconst uniqueRange = this.getUniqueRanges()\n\n\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier()\n\t\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier()\n\n\t\t\t// Create a column\n\t\t\tconst range: any = {}\n\t\t\tuniqueRange.forEach((ran: any) => {\n\t\t\t\t// Initialize matrix to empty state\n\t\t\t\trange[ran] = {\n\t\t\t\t\tvalue: null,\n\t\t\t\t\tindex: -1\n\t\t\t\t}\n\t\t\t})\n\n\t\t\t// Complete the matrix by cloning the column to all domains\n\t\t\tuniqueDomain.forEach((dom: any) => {\n\t\t\t\tthis._matrix[dom] = cloneDeep(range)\n\t\t\t})\n\n\t\t\t// Fill in user passed data\n\t\t\tthis.getDisplayData().forEach((d: any, i: number) => {\n\t\t\t\tthis._matrix[d[domainIdentifier]][d[rangeIdentifier]] = {\n\t\t\t\t\tvalue: d['value'],\n\t\t\t\t\tindex: i\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\treturn this._matrix\n\t}\n\n\t/**\n\t *\n\t * @param newData The new raw data to be set\n\t */\n\tsetData(newData: any) {\n\t\tconst sanitizedData = this.sanitize(cloneDeep(newData))\n\t\tconst dataGroups = this.generateDataGroups(sanitizedData)\n\n\t\tthis.set({\n\t\t\tdata: sanitizedData,\n\t\t\tdataGroups\n\t\t})\n\n\t\t// Set attributes to empty\n\t\tthis._domains = []\n\t\tthis._ranges = []\n\t\tthis._matrix = {}\n\n\t\treturn sanitizedData\n\t}\n\n\t/**\n\t * Converts Object matrix into a single array\n\t * @returns object[]\n\t */\n\tgetMatrixAsArray(): object[] {\n\t\tif (isEmpty(this._matrix)) {\n\t\t\tthis.getMatrix()\n\t\t}\n\n\t\tconst uniqueDomain = this.getUniqueDomain()\n\t\tconst uniqueRange = this.getUniqueRanges()\n\n\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier()\n\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier()\n\n\t\tconst arr: any[] = []\n\t\tuniqueDomain.forEach(domain => {\n\t\t\tuniqueRange.forEach(range => {\n\t\t\t\tconst element: any = {\n\t\t\t\t\tvalue: this._matrix[domain][range].value,\n\t\t\t\t\tindex: this._matrix[domain][range].index\n\t\t\t\t}\n\t\t\t\telement[domainIdentifier] = domain\n\t\t\t\telement[rangeIdentifier] = range\n\t\t\t\tarr.push(element)\n\t\t\t})\n\t\t})\n\n\t\treturn arr\n\t}\n\n\t/**\n\t * Generate tabular data from display data\n\t * @returns Array<Object>\n\t */\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\n\t\tconst { primaryDomain, primaryRange } = this.assignRangeAndDomains()\n\n\t\tlet domainValueFormatter: any\n\t\tconst headers = [primaryDomain.label, primaryRange.label, 'Value']\n\t\tconst cells = [\n\t\t\t...displayData.map((datum: any) => [\n\t\t\t\tdatum[primaryDomain.identifier] === null\n\t\t\t\t\t? '–'\n\t\t\t\t\t: domainValueFormatter\n\t\t\t\t\t\t? domainValueFormatter(datum[primaryDomain.identifier])\n\t\t\t\t\t\t: datum[primaryDomain.identifier],\n\n\t\t\t\tdatum[primaryRange.identifier] === null\n\t\t\t\t\t? '–'\n\t\t\t\t\t: datum[primaryRange.identifier].toLocaleString(),\n\t\t\t\tdatum['value']\n\t\t\t])\n\t\t]\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n\n\t// Uses quantize scale to return class names\n\tgetColorClassName(configs: { value?: number; originalClassName?: string }) {\n\t\treturn `${configs.originalClassName} ${this._colorScale(configs.value as number)}`\n\t}\n\n\tprotected setColorClassNames() {\n\t\tconst options = this.getOptions()\n\n\t\tconst customColors = getProperty(options, 'color', 'gradient', 'colors')\n\t\tconst customColorsEnabled = !isEmpty(customColors)\n\n\t\tlet colorPairingOption = getProperty(options, 'color', 'pairing', 'option')\n\n\t\t// If domain consists of negative and positive values, use diverging palettes\n\t\tconst domain = this.getValueDomain()\n\t\tconst colorScheme = domain[0] < 0 && domain[1] > 0 ? 'diverge' : 'mono'\n\n\t\t// Use default color pairing options if not in defined range\n\t\tif (colorPairingOption < 1 && colorPairingOption > 4 && colorScheme === 'mono') {\n\t\t\tcolorPairingOption = 1\n\t\t} else if (colorPairingOption < 1 && colorPairingOption > 2 && colorScheme === 'diverge') {\n\t\t\tcolorPairingOption = 1\n\t\t}\n\n\t\t// Uses css classes for fill\n\t\tconst colorPairing = customColorsEnabled ? customColors : []\n\n\t\tif (!customColorsEnabled) {\n\t\t\t// Add class names to list and the amount based on the color scheme\n\t\t\t// Carbon charts has 11 colors for a single monochromatic palette & 17 for a divergent palette\n\t\t\tconst colorGroupingLength = colorScheme === 'diverge' ? 17 : 11\n\t\t\tfor (let i = 1; i < colorGroupingLength + 1; i++) {\n\t\t\t\tcolorPairing.push(`fill-${colorScheme}-${colorPairingOption}-${i}`)\n\t\t\t}\n\t\t}\n\n\t\t// Save scale type\n\t\tthis._colorScale = scaleQuantize()\n\t\t\t.domain(domain as [number, number])\n\t\t\t.range(colorPairing)\n\t\tconst colorOptions = getProperty(this.getOptions(), 'color')\n\t\tthis._colorScale = getColorScale(this.getDisplayData(), colorOptions)\n\t}\n}\n","import { AxisChart } from '@/axis-chart'\nimport { options as configOptions } from '@/configuration'\nimport { getProperty, mergeDefaultChartOptions } from '@/tools'\nimport { HeatmapModel } from '@/model/heatmap'\nimport type { HeatmapChartOptions } from '@/interfaces/charts'\nimport type { ChartConfig } from '@/interfaces/model'\nimport { LayoutDirection, LayoutGrowth, RenderTypes, LayoutAlignItems } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Heatmap } from '@/components/graphs/heatmap'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { Modal } from '@/components/essentials/modal'\nimport { LayoutComponent } from '@/components/layout/layout'\nimport { ColorScaleLegend } from '@/components/essentials/color-scale-legend'\nimport { Title } from '@/components/essentials/title'\nimport { AxisChartsTooltip } from '@/components/essentials/tooltip-axis'\nimport { Spacer } from '@/components/layout/spacer'\nimport { Toolbar } from '@/components/axes/toolbar'\n\nexport class HeatmapChart extends AxisChart {\n\tmodel = new HeatmapModel(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<HeatmapChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(\n\t\t\tmergeDefaultChartOptions(configOptions.heatmapChart, chartConfigs.options)\n\t\t)\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t// Custom getChartComponents - Implements getChartComponents\n\t// Removes zoombar support and additional `features` that are not supported in heatmap\n\tprotected getAxisChartComponents(graphFrameComponents: any[], configs?: any) {\n\t\tconst options = this.model.getOptions()\n\t\tconst toolbarEnabled = getProperty(options, 'toolbar', 'enabled')\n\n\t\tthis.services.cartesianScales.determineAxisDuality()\n\t\tthis.services.cartesianScales.findDomainAndRangeAxes() // need to do this before getMainXAxisPosition()\n\t\tthis.services.cartesianScales.determineOrientation()\n\n\t\tconst titleAvailable = !!this.model.getOptions().title\n\t\tconst titleComponent = {\n\t\t\tid: 'title',\n\t\t\tcomponents: [new Title(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.STRETCH\n\t\t}\n\n\t\tconst toolbarComponent = {\n\t\t\tid: 'toolbar',\n\t\t\tcomponents: [new Toolbar(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst headerComponent = {\n\t\t\tid: 'header',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t// always add title to keep layout correct\n\t\t\t\t\t\ttitleComponent,\n\t\t\t\t\t\t...(toolbarEnabled ? [toolbarComponent] : [])\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: LayoutDirection.ROW,\n\t\t\t\t\t\talignItems: LayoutAlignItems.CENTER\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst legendComponent = {\n\t\t\tid: 'legend',\n\t\t\tcomponents: [\n\t\t\t\tnew ColorScaleLegend(this.model, this.services, {\n\t\t\t\t\tchartType: 'heatmap'\n\t\t\t\t})\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t\trenderType: RenderTypes.SVG\n\t\t}\n\n\t\tconst graphFrameComponent = {\n\t\t\tid: 'graph-frame',\n\t\t\tcomponents: graphFrameComponents,\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t\trenderType: RenderTypes.SVG\n\t\t}\n\n\t\tconst isLegendEnabled =\n\t\t\tgetProperty(configs, 'legend', 'enabled') !== false &&\n\t\t\tthis.model.getOptions().legend.enabled !== false\n\n\t\t// Decide the position of the legend in reference to the chart\n\t\tconst fullFrameComponentDirection = LayoutDirection.COLUMN_REVERSE\n\n\t\tconst legendSpacerComponent = {\n\t\t\tid: 'spacer',\n\t\t\tcomponents: [new Spacer(this.model, this.services, { size: 15 })],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst fullFrameComponent = {\n\t\t\tid: 'full-frame',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t...(isLegendEnabled ? [legendComponent] : []),\n\t\t\t\t\t\t...(isLegendEnabled ? [legendSpacerComponent] : []),\n\t\t\t\t\t\tgraphFrameComponent\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: fullFrameComponentDirection\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.STRETCH\n\t\t}\n\n\t\tconst topLevelLayoutComponents: any[] = []\n\t\t// header component is required for either title or toolbar\n\t\tif (titleAvailable || toolbarEnabled) {\n\t\t\ttopLevelLayoutComponents.push(headerComponent)\n\n\t\t\tconst titleSpacerComponent = {\n\t\t\t\tid: 'spacer',\n\t\t\t\tcomponents: [\n\t\t\t\t\tnew Spacer(this.model, this.services, toolbarEnabled ? { size: 15 } : undefined)\n\t\t\t\t],\n\t\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t\t}\n\n\t\t\ttopLevelLayoutComponents.push(titleSpacerComponent)\n\t\t}\n\t\ttopLevelLayoutComponents.push(fullFrameComponent)\n\n\t\treturn [\n\t\t\tnew AxisChartsTooltip(this.model, this.services),\n\t\t\tnew Modal(this.model, this.services),\n\t\t\tnew LayoutComponent(this.model, this.services, topLevelLayoutComponents, {\n\t\t\t\tdirection: LayoutDirection.COLUMN\n\t\t\t})\n\t\t]\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Heatmap(this.model, this.services)\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","// Internal Imports\nimport { ChartModelCartesian } from './cartesian-charts'\n\nimport { get } from 'lodash-es'\n\n/**\n * this is intended for binned type of charts\n * */\nexport class ChartModelBinned extends ChartModelCartesian {\n\tgetTabularDataArray() {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst binnedStackedData = this.getBinnedStackedData()\n\n const headers = [\n\t\t\tget(options, 'bins.rangeLabel') || 'Range',\n\t\t\t...binnedStackedData.map(datum => get(datum, `0.${groupMapsTo}`))\n\t\t]\n\t\tconst cells = [\n\t\t\t...get(binnedStackedData, 0).map((d, i) => [\n\t\t\t\t`${get(d, 'data.x0')} – ${get(d, 'data.x1')}`,\n\t\t\t\t...binnedStackedData.map(datum => get(datum[i], `data.${get(datum[i], groupMapsTo)}`))\n\t\t\t])\n\t\t]\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n}\n","import { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport { ChartModelBinned } from '@/model/binned-charts'\nimport type { HistogramChartOptions } from '@/interfaces/charts'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { Histogram } from '@/components/graphs/histogram'\nimport { BinnedRuler } from '@/components/axes/ruler-binned'\n\nexport class HistogramChart extends AxisChart {\n\tmodel = new ChartModelBinned(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<HistogramChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.histogramChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\n\t\tthis.update()\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew BinnedRuler(this.model, this.services),\n\t\t\tnew Histogram(this.model, this.services)\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\n\t\treturn components\n\t}\n}\n","import { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { LineChartOptions } from '@/interfaces/charts'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { Ruler } from '@/components/axes/ruler'\nimport { Line } from '@/components/graphs/line'\nimport { Scatter } from '@/components/graphs/scatter'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { ZeroLine } from '@/components/axes/zero-line'\nimport { SkeletonLines } from '@/components/graphs/skeleton-lines'\n\nexport class LineChart extends AxisChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<LineChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.lineChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew Ruler(this.model, this.services),\n\t\t\tnew Line(this.model, this.services),\n\t\t\tnew Scatter(this.model, this.services, { handleThresholds: true }),\n\t\t\tnew SkeletonLines(this.model, this.services),\n\t\t\tnew ZeroLine(this.model, this.services)\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { LollipopChartOptions } from '@/interfaces/charts'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { Ruler } from '@/components/axes/ruler'\nimport { Scatter } from '@/components/graphs/scatter'\nimport { Lollipop } from '@/components/graphs/lollipop'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { Skeleton } from '@/components/graphs/skeleton'\n\nexport class LollipopChart extends AxisChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<LollipopChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.lollipopChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew Ruler(this.model, this.services),\n\t\t\tnew Lollipop(this.model, this.services),\n\t\t\tnew Scatter(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.GRID\n\t\t\t})\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { getProperty } from '@/tools'\nimport { ChartModel } from './model'\nimport { ChartTabularData } from '@/interfaces/model'\n\n/** The meter chart model layer which extends some of the data setting options.\n * Meter only uses 1 dataset\n * */\n\nexport class MeterChartModel extends ChartModel {\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\tgetMaximumDomain(data: any) {\n\t\tconst max = data.reduce((accumulator: number, datum: any) => accumulator + datum.value, 0)\n\t\treturn max\n\t}\n\n\t/**\n\t * Use a provided color for the bar or default to carbon color if no status provided.\n\t * Defaults to carbon color otherwise.\n\t * @param group dataset group label\n\t */\n\tgetFillColor(group: string) {\n\t\tconst options = this.getOptions()\n\t\tconst userProvidedScale = getProperty(options, 'color', 'scale')\n\t\tconst status = this.getStatus()\n\t\t// user provided a fill color or there isn't a status we can use the colorScale\n\t\tif (userProvidedScale || !status) {\n\t\t\treturn super.getFillColor(group)\n\t\t} else {\n\t\t\treturn null\n\t\t}\n\t}\n\n\t/**\n\t * Get the associated status for the data by checking the ranges\n\t */\n\tgetStatus() {\n\t\tconst options = this.getOptions()\n\t\tconst dataValues = getProperty(this.getDisplayData())\n\n\t\tconst totalValue =\n\t\t\tdataValues?.reduce((previous: any, current: any) => {\n\t\t\t\treturn previous + current.value\n\t\t\t}, 0) ?? 0\n\n\t\t// use max value if the percentage is bigger than 100%\n\t\tconst boundedValue = getProperty(options, 'meter', 'proportional')\n\t\t\t? totalValue\n\t\t\t: totalValue > 100\n\t\t\t\t? 100\n\t\t\t\t: totalValue\n\n\t\t// user needs to supply ranges\n\t\tconst allRanges = getProperty(options, 'meter', 'status', 'ranges')\n\n\t\tif (allRanges) {\n\t\t\tconst result = allRanges.filter(\n\t\t\t\t(step: any) => step.range[0] <= boundedValue && boundedValue <= step.range[1]\n\t\t\t)\n\t\t\tif (result.length > 0) {\n\t\t\t\treturn result[0].status\n\t\t\t}\n\t\t}\n\n\t\treturn null\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst status = this.getStatus()\n\t\tconst proportional = getProperty(options, 'meter', 'proportional')\n\t\tlet headers = []\n\t\tlet cells: ChartTabularData = []\n\t\tlet domainMax: number\n\t\t// Display the appropriate columns and fields depending on the type of meter\n\t\tif (proportional === null) {\n\t\t\tdomainMax = 100\n\t\t\tconst datum = displayData[0]\n\t\t\theaders = ['Group', 'Value', ...(status ? ['Status'] : [])]\n\t\t\tcells = [[datum[groupMapsTo], datum['value'], ...(status ? [status] : [])]]\n\t\t} else {\n\t\t\tconst total = getProperty(proportional, 'total')\n\t\t\tdomainMax = total ? total : this.getMaximumDomain(displayData)\n\t\t\theaders = ['Group', 'Value', 'Percentage of total']\n\t\t\tcells = [\n\t\t\t\t...displayData.map((datum: any) => [\n\t\t\t\t\tdatum[groupMapsTo],\n\t\t\t\t\tdatum['value'],\n\t\t\t\t\t((datum['value'] / domainMax) * 100).toFixed(2) + ' %'\n\t\t\t\t])\n\t\t\t]\n\t\t}\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n}\n","import { cloneDeep, merge } from 'lodash-es'\nimport { Chart } from '@/chart'\nimport { options as configOptions } from '@/configuration'\nimport { getProperty } from '@/tools'\nimport { MeterChartModel } from '@/model/meter'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { MeterChartOptions } from '@/interfaces/charts'\nimport { LayoutGrowth, LayoutDirection, RenderTypes } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { LayoutComponent } from '@/components/layout'\nimport { Meter } from '@/components/graphs/meter'\nimport { MeterTitle } from '@/components/essentials/title-meter'\nimport { Spacer } from '@/components/layout/spacer'\n\nexport class MeterChart extends Chart {\n\tmodel = new MeterChartModel(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<MeterChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// use prop meter options or regular meter options\n\t\tconst options = chartConfigs.options.meter?.proportional\n\t\t\t? merge(cloneDeep(configOptions.proportionalMeterChart), chartConfigs.options)\n\t\t\t: merge(cloneDeep(configOptions.meterChart), chartConfigs.options)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(options)\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetComponents() {\n\t\tconst showLabels = getProperty(this.model.getOptions(), 'meter', 'showLabels')\n\t\tconst meterComponents = [\n\t\t\t...(showLabels\n\t\t\t\t? [\n\t\t\t\t\t\t// Meter has a unique dataset title within the graph\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: 'meter-title',\n\t\t\t\t\t\t\tcomponents: [new MeterTitle(this.model, this.services)],\n\t\t\t\t\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t\t\t\t\t\trenderType: RenderTypes.SVG\n\t\t\t\t\t\t},\n\t\t\t\t\t\t// Create the title spacer\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: 'spacer',\n\t\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t\tnew Spacer(this.model, this.services, {\n\t\t\t\t\t\t\t\t\tsize: 8\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\tgrowth: LayoutGrowth.STRETCH\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t: []),\n\t\t\t// Specify what to render inside the graph only\n\t\t\t{\n\t\t\t\tid: 'meter-graph',\n\t\t\t\tcomponents: [new Meter(this.model, this.services)],\n\t\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t\t\trenderType: RenderTypes.SVG\n\t\t\t}\n\t\t]\n\n\t\t// the graph frame for meter includes the custom title (and spacer)\n\t\tconst graphFrame: Component[] = [\n\t\t\tnew LayoutComponent(this.model, this.services, meterComponents, {\n\t\t\t\tdirection: LayoutDirection.COLUMN\n\t\t\t})\n\t\t]\n\n\t\t// add the meter title as a top level component\n\t\tconst components: Component[] = this.getChartComponents(graphFrame, {\n\t\t\tgraphFrameRenderType: RenderTypes.HTML\n\t\t})\n\n\t\treturn components\n\t}\n}\n","import { getProperty } from '@/tools'\nimport { ChartModelCartesian } from './cartesian-charts'\n\n/** The charting model layer which includes mainly the chart data and options,\n * as well as some misc. information to be shared among components */\nexport class RadarChartModel extends ChartModelCartesian {\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst options = this.getOptions()\n\n\t\tconst groupedData = this.getGroupedData()\n\n\t\tconst { angle, value } = getProperty(options, 'radar', 'axes')\n\n\t\tconst additionalHeaders = getProperty(groupedData, '0', 'data').map((d: any) => d[angle])\n\t\tconst headers = ['Group', ...additionalHeaders]\n\t\tconst cells = [\n\t\t\t...groupedData.map(datum => {\n\t\t\t\treturn [\n\t\t\t\t\tdatum['name'],\n\t\t\t\t\t...additionalHeaders.map((_: any, i: number) =>\n\t\t\t\t\t\tgetProperty(datum, 'data', i, value) !== null\n\t\t\t\t\t\t\t? getProperty(datum, 'data', i, value).toLocaleString()\n\t\t\t\t\t\t\t: '–'\n\t\t\t\t\t)\n\t\t\t\t]\n\t\t\t})\n\t\t]\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n}\n","import { Chart } from '@/chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport { RadarChartModel } from '@/model/radar'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { RadarChartOptions } from '@/interfaces/charts'\nimport type { Component } from '@/components/component'\nimport { Radar } from '@/components/graphs/radar'\n\nexport class RadarChart extends Chart {\n\tmodel = new RadarChartModel(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<RadarChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.radarChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [new Radar(this.model, this.services)]\n\n\t\t// get the base chart components and export with tooltip\n\t\tconst components: Component[] = this.getChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { ScatterChartOptions } from '@/interfaces/charts'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { Ruler } from '@/components/axes/ruler'\nimport { Scatter } from '@/components/graphs/scatter'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { Skeleton } from '@/components/graphs/skeleton'\n\nexport class ScatterChart extends AxisChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<ScatterChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.scatterChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew Ruler(this.model, this.services),\n\t\t\tnew Scatter(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.GRID\n\t\t\t})\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { ChartModel } from './model'\n\n/**\n * The tree chart model layer\n */\nexport class TreeChartModel extends ChartModel {\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\n\t\tconst headers = ['Child', 'Parent']\n\t\tconst cells = []\n\t\tdisplayData.forEach((datum: any) => {\n\t\t\t// Call recurisve function\n\t\t\tthis.getChildrenDatums(datum, cells)\n\t\t\tcells.push([datum.name, '–'])\n\t\t})\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n\n\t/**\n\t * Determine the child parent relationship in nested data\n\t * @param datum: Object\n\t * @param result: Array<Object>\n\t */\n\tprivate getChildrenDatums(datum: any, result: any[] = []) {\n\t\t// Check to see if datum has children before iterating through it\n\t\tif (datum.children) {\n\t\t\tif (datum.children.length > 0) {\n\t\t\t\tdatum.children.forEach((child: any) => {\n\t\t\t\t\tthis.getChildrenDatums(child, result)\n\t\t\t\t\tresult.push([child.name, datum.name])\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Chart } from '@/chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport { TreeChartModel } from '@/model/tree'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { TreeChartOptions } from '@/interfaces/charts'\nimport type { Component } from '@/components/component'\nimport { Tree } from '@/components/graphs/tree'\n\nexport class TreeChart extends Chart {\n\tmodel = new TreeChartModel(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<TreeChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.treeChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [new Tree(this.model, this.services)]\n\n\t\t// get the base chart components and export with tooltip\n\t\tconst components: Component[] = this.getChartComponents(graphFrameComponents, {\n\t\t\texcludeLegend: true\n\t\t})\n\t\treturn components\n\t}\n}\n","import { getProperty } from '@/tools'\nimport { ChartModel } from './model'\n\n/**\n * The treemap chart model layer\n */\nexport class TreemapChartModel extends ChartModel {\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\n\t\tconst headers = ['Child', 'Group', 'Value']\n\t\tconst cells = []\n\t\tdisplayData.forEach((datum: any) => {\n\t\t\tif (Array.isArray(datum.children)) {\n\t\t\t\tdatum.children.forEach((child: any) => {\n\t\t\t\t\tcells.push([child.name, datum.name, child.value])\n\t\t\t\t})\n\t\t\t} else if (getProperty(datum.name) !== null && getProperty(datum.value)) {\n\t\t\t\tcells.push(['–', datum.name, datum.value])\n\t\t\t}\n\t\t})\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n}\n","import { Chart } from '@/chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport { TreemapChartModel } from '@/model/treemap'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { TreemapChartOptions } from '@/interfaces/charts'\nimport type { Component } from '@/components/component'\nimport { Treemap } from '@/components/graphs/treemap'\n\nexport class TreemapChart extends Chart {\n\tmodel = new TreemapChartModel(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<TreemapChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.treemapChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [new Treemap(this.model, this.services)]\n\n\t\t// get the base chart components and export with tooltip\n\t\tconst components: Component[] = this.getChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { ChartConfig } from '@/interfaces/model'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { BarChartOptions } from '@/interfaces/charts'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { Skeleton } from '@/components/graphs/skeleton'\nimport { ZeroLine } from '@/components/axes/zero-line'\nimport { SimpleBar } from '@/components/graphs/bar-simple'\n\nexport class SimpleBarChart extends AxisChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<BarChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.simpleBarChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew SimpleBar(this.model, this.services),\n\t\t\tnew ZeroLine(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.VERT_OR_HORIZ\n\t\t\t})\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { Component } from '@/components/component'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { AreaChartOptions } from '@/interfaces/charts'\nimport { Skeletons } from '@/interfaces/enums'\nimport { Grid } from '@/components/axes/grid'\nimport { StackedArea } from '@/components/graphs/area-stacked'\nimport { StackedRuler } from '@/components/axes/ruler-stacked'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { Line } from '@/components/graphs/line'\nimport { StackedScatter } from '@/components/graphs/scatter-stacked'\nimport { Skeleton } from '@/components/graphs/skeleton'\n\nexport class StackedAreaChart extends AxisChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<AreaChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.stackedAreaChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew StackedRuler(this.model, this.services),\n\t\t\tnew StackedArea(this.model, this.services),\n\t\t\tnew Line(this.model, this.services, { stacked: true }),\n\t\t\tnew StackedScatter(this.model, this.services, {\n\t\t\t\tfadeInOnChartHolderMouseover: true,\n\t\t\t\thandleThresholds: true,\n\t\t\t\tstacked: true\n\t\t\t}),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.GRID\n\t\t\t})\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { ChartConfig } from '@/interfaces/model'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { BarChartOptions } from '@/interfaces/charts'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { StackedBar } from '@/components/graphs/bar-stacked'\nimport { StackedRuler } from '@/components/axes/ruler-stacked'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { ZeroLine } from '@/components/axes/zero-line'\nimport { Skeleton } from '@/components/graphs/skeleton'\n\nexport class StackedBarChart extends AxisChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<BarChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.stackedBarChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew StackedRuler(this.model, this.services),\n\t\t\tnew StackedBar(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.VERT_OR_HORIZ\n\t\t\t}),\n\t\t\tnew ZeroLine(this.model, this.services)\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { ChartModel } from './model'\n\n/** The charting model layer which includes mainly the chart data and options,\n * as well as some misc. information to be shared among components */\nexport class WordCloudModel extends ChartModel {\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\n\t\tconst options = this.getOptions()\n\t\tconst { fontSizeMapsTo, wordMapsTo } = options.wordCloud\n\t\tconst { groupMapsTo } = options.data\n\t\tconst headers = [options.tooltip.wordLabel, 'Group', options.tooltip.valueLabel]\n\t\tconst cells = [\n\t\t\t...displayData.map((datum: any) => [\n\t\t\t\tdatum[wordMapsTo],\n\t\t\t\tdatum[groupMapsTo],\n\t\t\t\tdatum[fontSizeMapsTo]\n\t\t\t])\n\t\t]\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n}\n","import { Chart } from '@/chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport { WordCloudModel } from '@/model/wordcloud'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { WorldCloudChartOptions } from '@/interfaces/charts'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Skeleton } from '@/components/graphs/skeleton'\nimport { WordCloud } from '@/components/graphs/wordcloud'\n\nexport class WordCloudChart extends Chart {\n\tmodel = new WordCloudModel(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig<WorldCloudChartOptions>) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.wordCloudChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew WordCloud(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.PIE\n\t\t\t})\n\t\t]\n\n\t\t// get the base chart components and export with tooltip\n\t\tconst components: Component[] = this.getChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n"],"names":["ascending","a","b","descending","bisector","f","compare1","compare2","delta","d","x","zero","left","lo","hi","mid","right","center","i","number","numbers","values","valueof","value","index","bisectRight","bisect","count","extent","min","max","Adder","p","j","y","InternMap","entries","key","keyof","intern_get","intern_set","intern_delete","_intern","_key","identity","compareDefined","compare","ascendingDefined","array","slice","constant","e10","e5","e2","tickSpec","start","stop","step","power","error","factor","i1","i2","inc","ticks","reverse","n","tickIncrement","tickStep","nice","prestep","thresholdSturges","bin","domain","threshold","sturges","histogram","data","xz","x0","x1","tz","tn","m","bins","_","quickselect","k","z","s","sd","newLeft","newRight","t","swap","quantile","i0","value0","value1","flatten","arrays","merge","range","identity$7","top","bottom","epsilon","translateX","translateY","scale","offset","entering","axis","orient","tickArguments","tickValues","tickFormat","tickSizeInner","tickSizeOuter","tickPadding","transform","context","format","spacing","range0","range1","position","selection","path","tick","tickExit","tickEnter","line","text","axisTop","axisRight","axisBottom","axisLeft","noop","dispatch","Dispatch","parseTypenames","typenames","types","name","typename","callback","T","get","set","copy","type","that","args","c","xhtml","namespaces","namespace","prefix","creatorInherit","document","uri","creatorFixed","fullname","creator","none","selector","selection_select","select","groups","subgroups","group","subgroup","node","subnode","Selection","empty","selectorAll","arrayAll","selection_selectAll","parents","matcher","childMatcher","find","childFind","match","childFirst","selection_selectChild","filter","children","childrenFilter","selection_selectChildren","selection_filter","sparse","update","selection_enter","EnterNode","parent","datum","child","next","constant$7","bindIndex","enter","exit","groupLength","dataLength","bindKey","nodeByKeyValue","keyValues","keyValue","selection_data","bind","arraylike","enterGroup","updateGroup","exitGroup","previous","selection_exit","selection_join","onenter","onupdate","onexit","selection_merge","groups0","groups1","m0","m1","merges","group0","group1","selection_order","selection_sort","compareNode","sortgroups","sortgroup","selection_call","selection_nodes","selection_node","selection_size","size","selection_empty","selection_each","attrRemove","attrRemoveNS","attrConstant","attrConstantNS","attrFunction","v","attrFunctionNS","selection_attr","defaultView","styleRemove","styleConstant","priority","styleFunction","selection_style","styleValue","propertyRemove","propertyConstant","propertyFunction","selection_property","classArray","string","classList","ClassList","classedAdd","names","list","classedRemove","classedTrue","classedFalse","classedFunction","selection_classed","textRemove","textConstant","textFunction","selection_text","htmlRemove","htmlConstant","htmlFunction","selection_html","raise","selection_raise","lower","selection_lower","selection_append","create","constantNull","selection_insert","before","remove","selection_remove","selection_cloneShallow","clone","selection_cloneDeep","selection_clone","deep","selection_datum","contextListener","listener","event","onRemove","on","o","onAdd","options","selection_on","dispatchEvent","params","window","dispatchConstant","dispatchFunction","selection_dispatch","selection_iterator","root","selection_selection","sourceEvent","pointer","svg","point","rect","nonpassivecapture","noevent$1","dragDisable","view","noevent","yesdrag","noclick","define","constructor","factory","prototype","extend","definition","Color","darker","brighter","reI","reN","reP","reHex","reRgbInteger","reRgbPercent","reRgbaInteger","reRgbaPercent","reHslPercent","reHslaPercent","named","color","channels","color_formatHex","color_formatHex8","color_formatHsl","color_formatRgb","hslConvert","l","rgbn","Rgb","rgba","hsla","r","g","rgbConvert","rgb","opacity","clampi","clampa","rgb_formatHex","rgb_formatHex8","rgb_formatRgb","hex","h","Hsl","hsl","m2","hsl2rgb","clamph","clampt","constant$6","linear","exponential","gamma","nogamma","interpolateRgb","rgbGamma","end","colorRgb","numberArray","isNumberArray","genericArray","nb","na","date$1","interpolateNumber","object$1","reA","reB","one","interpolateString","bi","am","bm","bs","q","interpolate$1","date","object","interpolateRound","degrees","decompose","e","scaleX","scaleY","skewX","svgNode","parseCss","parseSvg","interpolateTransform","parse","pxComma","pxParen","degParen","pop","translate","xa","ya","xb","yb","rotate","interpolateTransformCss","interpolateTransformSvg","quantize$1","interpolator","samples","frame","timeout","interval","pokeDelay","taskHead","taskTail","clockLast","clockNow","clockSkew","clock","setFrame","now","clearNow","Timer","timer","delay","time","sleep","timerFlush","wake","nap","poke","t0","t1","t2","elapsed","emptyOn","emptyTween","CREATED","SCHEDULED","STARTING","STARTED","RUNNING","ENDING","ENDED","schedule","id","timing","schedules","init","self","tween","interrupt","active","selection_interrupt","tweenRemove","tween0","tween1","tweenFunction","transition_tween","tweenValue","transition","interpolate","string00","string1","interpolate0","string0","string10","transition_attr","attrInterpolate","attrInterpolateNS","attrTweenNS","attrTween","transition_attrTween","delayFunction","delayConstant","transition_delay","durationFunction","durationConstant","transition_duration","easeConstant","transition_ease","easeVarying","transition_easeVarying","transition_filter","Transition","transition_merge","onFunction","on0","on1","sit","transition_on","removeFunction","transition_remove","transition_select","transition_selectAll","inherit","transition_selection","styleNull","style","styleMaybeRemove","listener0","transition_style","styleInterpolate","styleTween","transition_styleTween","transition_text","textInterpolate","textTween","transition_textTween","transition_transition","id0","id1","newId","transition_end","resolve","reject","cancel","selection_prototype","cubicInOut","defaultTiming","easeCubicInOut","selection_transition","constant$5","BrushEvent","target","mode","nopropagation","MODE_DRAG","MODE_SPACE","MODE_HANDLE","MODE_CENTER","abs","number1","number2","X","xy","Y","cursors","flipX","flipY","signsX","signsY","defaultFilter","defaultExtent","defaultTouchable","local","brushX","brush","dim","touchable","keys","listeners","handleSize","touchending","overlay","initialize","handle","redraw","started","touchmoved","touchended","emitter","state","emit","selection0","selection1","clean","Emitter","signX","signY","W","w0","w1","N","n0","n1","E","e0","e1","S","s0","s1","dx","dy","moving","shifting","lockX","lockY","points","pts","move","moved","ended","keydowned","keyupped","point0","dragEnable","pi","tau","tauEpsilon","append","strings","appendRound","digits","Path$1","y1","x2","y2","y0","x21","y21","x01","y01","l01_2","x20","y20","l21_2","l20_2","l21","l01","t01","t21","a0","a1","ccw","cw","da","w","formatDecimal","formatDecimalParts","coefficient","exponent","formatGroup","grouping","thousands","width","length","formatNumerals","numerals","re","formatSpecifier","specifier","FormatSpecifier","formatTrim","out","prefixExponent","formatPrefixAuto","formatRounded","formatTypes","identity$5","map","prefixes","formatLocale$1","locale","currencyPrefix","currencySuffix","decimal","percent","minus","nan","newFormat","fill","align","sign","symbol","comma","precision","trim","suffix","formatType","maybeSuffix","valuePrefix","valueSuffix","valueNegative","padding","formatPrefix","defaultLocale","formatLocale","precisionFixed","precisionPrefix","precisionRound","epsilon2","halfPi","quarterPi","radians","atan","atan2","cos","exp","log","sin","sqrt","tan","acos","asin","streamGeometry","geometry","stream","streamGeometryType","streamObjectType","features","coordinates","streamLine","streamPolygon","geometries","closed","coordinate","geoStream","spherical","cartesian","lambda","phi","cosPhi","cartesianDot","cartesianCross","cartesianAddInPlace","cartesianScale","vector","cartesianNormalizeInPlace","compose","rotationIdentity","rotateRadians","deltaLambda","deltaPhi","deltaGamma","rotationLambda","rotationPhiGamma","forwardRotationLambda","rotation","cosDeltaPhi","sinDeltaPhi","cosDeltaGamma","sinDeltaGamma","forward","circleStream","radius","direction","cosRadius","sinRadius","circleRadius","clipBuffer","lines","result","pointEqual","Intersection","other","entry","clipRejoin","segments","compareIntersection","startInside","subject","clip","segment","p0","p1","link","current","isSubject","longitude","polygonContains","polygon","sinPhi","normal","angle","winding","sum","ring","lambda0","phi0","sinPhi0","cosPhi0","lambda1","sinPhi1","cosPhi1","point1","phi1","absDelta","antimeridian","arc","intersection","phiArc","pointVisible","clipLine","sink","ringBuffer","ringSink","polygonStarted","lineStart","lineEnd","pointRing","ringStart","ringEnd","pointLine","ringSegments","validSegment","clipAntimeridian","clipAntimeridianLine","clipAntimeridianInterpolate","sign0","sign1","clipAntimeridianIntersect","sinLambda0Lambda1","from","to","clipCircle","cr","smallRadius","notHemisphere","visible","c0","v0","v00","point2","code","intersect","two","pa","pb","n2","n2n2","n1n2","determinant","c1","c2","n1xn2","A","B","u","uu","polar","meridian","q1","ax","ay","bx","by","clipMax","clipMin","clipRectangle","corner","comparePoint","ca","cb","activeStream","bufferStream","x__","y__","v__","x_","y_","v_","first","clipStream","polygonStart","polygonEnd","polygonInside","b0","b1","cleanInside","linePoint","identity$4","areaSum","areaRingSum","x00","y00","areaStream","areaRingStart","areaRingEnd","area","areaPointFirst","areaPoint","pathArea","boundsStream","boundsPoint","bounds","boundsStream$1","X0","Y0","Z0","X1","Y1","Z1","X2","Y2","Z2","centroidStream","centroidPoint","centroidLineStart","centroidLineEnd","centroidRingStart","centroidRingEnd","centroid","centroidPointFirstLine","centroidPointLine","centroidPointFirstRing","centroidPointRing","pathCentroid","PathContext","lengthSum","lengthRing","lengthStream","lengthPointFirst","lengthPoint","pathMeasure","cacheDigits","cacheAppend","cacheRadius","cacheCircle","PathString","geoPath","projection","pointRadius","projectionStream","contextStream","pathBounds","transformer","methods","TransformStream","fit","fitBounds","fitExtent","fitSize","fitWidth","fitHeight","height","maxDepth","cosMinDistance","resample","project","delta2","resampleNone","resampleLineTo","depth","d2","phi2","lambda2","dx2","dy2","dz","lambda00","a00","b00","c00","resampleStream","ringPoint","transformRadians","transformRotate","scaleTranslate","sx","sy","scaleTranslateRotate","alpha","cosAlpha","sinAlpha","ai","ci","fi","projectionMutator","projectAt","theta","preclip","postclip","projectResample","projectTransform","projectRotateTransform","cache","cacheStream","invert","reset","recenter","conicProjection","cylindricalEqualAreaRaw","conicEqualAreaRaw","sy0","r0","r0y","geoConicEqualArea","geoAlbers","conicEqualArea","mercatorRaw","geoMercator","mercatorProjection","clipExtent","reclip","equirectangularRaw","geoEquirectangular","conicEquidistantRaw","cy0","gy","nx","geoConicEquidistant","A1","A2","A3","A4","M","iterations","equalEarthRaw","l2","l6","fy","fpy","geoEqualEarth","naturalEarth1Raw","phi4","geoNaturalEarth1","defaultSeparation","meanX","meanXReduce","maxY","maxYReduce","leafLeft","leafRight","d3Cluster","separation","nodeSize","cluster","previousNode","node_count","node_each","node_eachBefore","nodes","node_eachAfter","node_find","node_sum","node_sort","node_path","ancestor","leastCommonAncestor","aNodes","bNodes","node_ancestors","node_descendants","node_leaves","leaves","node_links","links","node_iterator","hierarchy","mapChildren","objectChildren","Node","childs","computeHeight","node_copy","copyData","optional","required","constantZero","constant$4","lcg","array$1","shuffle","random","packEncloseRandom","circles","enclosesWeak","encloseBasis","extendBasis","enclosesWeakAll","enclosesNot","encloseBasis2","encloseBasis3","dr","encloseBasis1","r1","r2","r21","x3","y3","r3","a2","a3","b2","b3","c3","d1","d3","ab","place","intersects","score","circle","packSiblingsRandom","aa","sj","sk","pack","defaultRadius","D3Pack","radiusLeaf","packChildrenRandom","translateChild","roundNode","treemapDice","nextLeft","nextRight","moveSubtree","wm","wp","shift","change","executeShifts","nextAncestor","vim","TreeNode","treeRoot","tree","d3Tree","firstWalk","secondWalk","sizeNode","tx","kx","ky","siblings","midpoint","apportion","vip","vop","vom","sip","sop","sim","som","treemapSlice","squarifyRatio","ratio","rows","row","nodeValue","sumValue","minValue","maxValue","newRatio","minRatio","beta","squarify","custom","d3Treemap","tile","round","paddingStack","paddingInner","paddingTop","paddingRight","paddingBottom","paddingLeft","treemap","positionNode","initRange","implicit","ordinal","unknown","band","ordinalRange","bandwidth","paddingOuter","rescale","sequence","constants","unit","normalize","clamper","bimap","d0","polymap","source","interpolateValue","untransform","clamp","piecewise","output","input","continuous","linearish","maxIter","transformLog","transformExp","transformLogn","transformExpn","pow10","powp","base","logp","reflect","loggish","logs","pows","quantize","timeInterval","floori","offseti","field","test","millisecond","durationSecond","durationMinute","durationHour","durationDay","durationWeek","durationMonth","durationYear","second","timeMinute","timeHour","timeDay","utcDay","timeWeekday","timeSunday","timeMonday","timeTuesday","timeWednesday","timeThursday","timeFriday","timeSaturday","utcWeekday","utcSunday","utcMonday","utcTuesday","utcWednesday","utcThursday","utcFriday","utcSaturday","timeMonth","timeYear","utcYear","ticker","year","month","week","day","hour","minute","tickIntervals","tickInterval","timeTicks","timeTickInterval","localDate","utcDate","newDate","locale_dateTime","locale_date","locale_time","locale_periods","locale_weekdays","locale_shortWeekdays","locale_months","locale_shortMonths","periodRe","formatRe","periodLookup","formatLookup","weekdayRe","weekdayLookup","shortWeekdayRe","shortWeekdayLookup","monthRe","monthLookup","shortMonthRe","shortMonthLookup","formats","formatShortWeekday","formatWeekday","formatShortMonth","formatMonth","formatDayOfMonth","formatMicroseconds","formatYearISO","formatFullYearISO","formatHour24","formatHour12","formatDayOfYear","formatMilliseconds","formatMonthNumber","formatMinutes","formatPeriod","formatQuarter","formatUnixTimestamp","formatUnixTimestampSeconds","formatSeconds","formatWeekdayNumberMonday","formatWeekNumberSunday","formatWeekNumberISO","formatWeekdayNumberSunday","formatWeekNumberMonday","formatYear","formatFullYear","formatZone","formatLiteralPercent","utcFormats","formatUTCShortWeekday","formatUTCWeekday","formatUTCShortMonth","formatUTCMonth","formatUTCDayOfMonth","formatUTCMicroseconds","formatUTCYearISO","formatUTCFullYearISO","formatUTCHour24","formatUTCHour12","formatUTCDayOfYear","formatUTCMilliseconds","formatUTCMonthNumber","formatUTCMinutes","formatUTCPeriod","formatUTCQuarter","formatUTCSeconds","formatUTCWeekdayNumberMonday","formatUTCWeekNumberSunday","formatUTCWeekNumberISO","formatUTCWeekdayNumberSunday","formatUTCWeekNumberMonday","formatUTCYear","formatUTCFullYear","formatUTCZone","parses","parseShortWeekday","parseWeekday","parseShortMonth","parseMonth","parseLocaleDateTime","parseDayOfMonth","parseMicroseconds","parseYear","parseFullYear","parseHour24","parseDayOfYear","parseMilliseconds","parseMonthNumber","parseMinutes","parsePeriod","parseQuarter","parseUnixTimestamp","parseUnixTimestampSeconds","parseSeconds","parseWeekdayNumberMonday","parseWeekNumberSunday","parseWeekNumberISO","parseWeekdayNumberSunday","parseWeekNumberMonday","parseLocaleDate","parseLocaleTime","parseZone","parseLiteralPercent","pad","pads","newParse","Z","parseSpecifier","numberRe","percentRe","requoteRe","requote","dISO","dow","UTCdISO","timeFormat","calendar","formatMillisecond","formatSecond","formatMinute","formatHour","formatDay","formatWeek","timeWeek","timeSecond","constant$3","withPath","shape","Path","arcInnerRadius","arcOuterRadius","arcStartAngle","arcEndAngle","arcPadAngle","x10","y10","x32","y32","cornerTangents","rc","ox","oy","x11","y11","D","cx0","cx1","cy1","dx0","dy0","dx1","dy1","innerRadius","outerRadius","cornerRadius","padRadius","startAngle","endAngle","padAngle","buffer","a01","a11","a10","da0","da1","ap","rp","rc0","rc1","oc","kc","lc","Linear","curveLinear","defined","curve","pointX","pointY","defined0","area$1","x0z","y0z","arealine","identity$2","pie$1","sortValues","sort","pie","arcs","curveRadialLinear","curveRadial","Radial","radial","lineRadial","lineRadial$1","Bump","bumpX","linkSource","linkTarget","argv","linkHorizontal","noop$2","Basis","curveBasis","BasisClosed","curveBasisClosed","BasisOpen","curveBasisOpen","Bundle","curveBundle","bundle","Cardinal","tension","curveCardinal","cardinal","CardinalClosed","curveCardinalClosed","CardinalOpen","curveCardinalOpen","CatmullRom","x23","y23","curveCatmullRom","catmullRom","CatmullRomClosed","curveCatmullRomClosed","CatmullRomOpen","curveCatmullRomOpen","LinearClosed","curveLinearClosed","slope3","h0","h1","slope2","MonotoneX","MonotoneY","ReflectContext","monotoneX","monotoneY","Natural","px","controlPoints","py","curveNatural","Step","curveStep","stepBefore","stepAfter","none$1","series","order","stackValue","stackSeries","stack","orderNone","offsetNone","sz","oz","stackOffsetDiverging","yp","yn","Transform","location","freeGlobal","freeGlobal$1","freeSelf","root$1","Symbol","Symbol$2","objectProto","hasOwnProperty","nativeObjectToString","symToStringTag","getRawTag","isOwn","tag","unmasked","objectToString","nullTag","undefinedTag","baseGetTag","isObjectLike","symbolTag","isSymbol","arrayMap","iteratee","isArray","isArray$1","INFINITY","symbolProto","symbolToString","baseToString","reWhitespace","trimmedEndIndex","reTrimStart","baseTrim","isObject","NAN","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","toNumber","isBinary","asyncTag","funcTag","genTag","proxyTag","isFunction","coreJsData","coreJsData$1","maskSrcKey","uid","isMasked","func","funcProto","funcToString","toSource","reRegExpChar","reIsHostCtor","reIsNative","baseIsNative","pattern","getValue","getNative","WeakMap","WeakMap$2","objectCreate","baseCreate","proto","baseCreate$1","apply","thisArg","copyArray","HOT_COUNT","HOT_SPAN","nativeNow","shortOut","lastCalled","stamp","remaining","defineProperty","defineProperty$1","baseSetToString","setToString","setToString$1","arrayEach","baseFindIndex","predicate","fromIndex","fromRight","baseIsNaN","strictIndexOf","baseIndexOf","arrayIncludes","MAX_SAFE_INTEGER","reIsUint","isIndex","baseAssignValue","eq","assignValue","objValue","copyObject","props","customizer","isNew","newValue","nativeMax","overRest","otherArgs","baseRest","isLength","isArrayLike","isIterateeCall","createAssigner","assigner","sources","guard","isPrototype","Ctor","baseTimes","argsTag","baseIsArguments","propertyIsEnumerable","isArguments","isArguments$1","stubFalse","freeExports","exports","freeModule","moduleExports","Buffer","nativeIsBuffer","isBuffer","isBuffer$1","arrayTag","boolTag","dateTag","errorTag","mapTag","numberTag","objectTag","regexpTag","setTag","stringTag","weakMapTag","arrayBufferTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","typedArrayTags","baseIsTypedArray","baseUnary","freeProcess","nodeUtil","nodeUtil$1","nodeIsTypedArray","isTypedArray","isTypedArray$1","arrayLikeKeys","inherited","isArr","isArg","isBuff","isType","skipIndexes","overArg","arg","nativeKeys","nativeKeys$1","baseKeys","nativeKeysIn","baseKeysIn","isProto","keysIn","reIsDeepProp","reIsPlainProp","isKey","nativeCreate","nativeCreate$1","hashClear","hashDelete","HASH_UNDEFINED","hashGet","hashHas","hashSet","Hash","listCacheClear","assocIndexOf","arrayProto","splice","listCacheDelete","lastIndex","listCacheGet","listCacheHas","listCacheSet","ListCache","Map","Map$2","mapCacheClear","isKeyable","getMapData","mapCacheDelete","mapCacheGet","mapCacheHas","mapCacheSet","MapCache","FUNC_ERROR_TEXT","memoize","resolver","memoized","MAX_MEMOIZE_SIZE","memoizeCapped","rePropName","reEscapeChar","stringToPath","quote","subString","stringToPath$1","toString","castPath","toKey","baseGet","defaultValue","arrayPush","spreadableSymbol","isFlattenable","baseFlatten","isStrict","getPrototype","getPrototype$1","objectCtorString","isPlainObject","baseSlice","castSlice","rsAstralRange","rsComboMarksRange","reComboHalfMarksRange","rsComboSymbolsRange","rsComboRange","rsVarRange","rsZWJ","reHasUnicode","hasUnicode","asciiToArray","rsAstral","rsCombo","rsFitz","rsModifier","rsNonAstral","rsRegional","rsSurrPair","reOptMod","rsOptVar","rsOptJoin","rsSeq","rsSymbol","reUnicode","unicodeToArray","stringToArray","createCaseFirst","methodName","strSymbols","chr","trailing","upperFirst","upperFirst$1","capitalize","arrayReduce","accumulator","initAccum","basePropertyOf","deburredLetters","deburrLetter","deburrLetter$1","reLatin","reComboMark","deburr","reAsciiWord","asciiWords","reHasUnicodeWord","hasUnicodeWord","rsDingbatRange","rsLowerRange","rsMathOpRange","rsNonCharRange","rsPunctuationRange","rsSpaceRange","rsUpperRange","rsBreakRange","rsApos","rsBreak","rsDigits","rsDingbat","rsLower","rsMisc","rsUpper","rsMiscLower","rsMiscUpper","rsOptContrLower","rsOptContrUpper","rsOrdLower","rsOrdUpper","rsEmoji","reUnicodeWord","unicodeWords","words","reApos","createCompounder","camelCase","word","camelCase$1","baseClamp","upper","stackClear","stackDelete","stackGet","stackHas","LARGE_ARRAY_SIZE","stackSet","pairs","Stack","baseAssign","baseAssignIn","allocUnsafe","cloneBuffer","isDeep","arrayFilter","resIndex","stubArray","nativeGetSymbols","getSymbols","getSymbols$1","copySymbols","getSymbolsIn","getSymbolsIn$1","copySymbolsIn","baseGetAllKeys","keysFunc","symbolsFunc","getAllKeys","getAllKeysIn","DataView","DataView$2","Promise","Promise$2","Set","Set$2","promiseTag","dataViewCtorString","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","getTag","ctorString","getTag$1","initCloneArray","Uint8Array","Uint8Array$1","cloneArrayBuffer","arrayBuffer","cloneDataView","dataView","reFlags","cloneRegExp","regexp","symbolValueOf","cloneSymbol","cloneTypedArray","typedArray","initCloneByTag","initCloneObject","baseIsMap","nodeIsMap","isMap","isMap$1","baseIsSet","nodeIsSet","isSet","isSet$1","CLONE_DEEP_FLAG","CLONE_FLAT_FLAG","CLONE_SYMBOLS_FLAG","cloneableTags","baseClone","bitmask","isFlat","isFull","isFunc","stacked","subValue","cloneDeep","setCacheAdd","setCacheHas","SetCache","arraySome","cacheHas","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","equalArrays","equalFunc","isPartial","arrLength","othLength","arrStacked","othStacked","seen","arrValue","othValue","compared","othIndex","mapToArray","setToArray","equalByTag","convert","equalObjects","objProps","objLength","othProps","objStacked","skipCtor","objCtor","othCtor","baseIsEqualDeep","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","baseIsEqual","baseIsMatch","matchData","noCustomizer","srcValue","isStrictComparable","getMatchData","matchesStrictComparable","baseMatches","baseHasIn","hasPath","hasFunc","hasIn","baseMatchesProperty","baseProperty","basePropertyDeep","property","baseIteratee","arrayAggregator","setter","createBaseFor","iterable","baseFor","baseFor$1","baseForOwn","createBaseEach","eachFunc","collection","baseEach","baseEach$1","baseAggregator","createAggregator","initializer","now$1","nativeMin","debounce","wait","lastArgs","lastThis","maxWait","timerId","lastCallTime","lastInvokeTime","leading","maxing","invokeFunc","leadingEdge","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","shouldInvoke","trailingEdge","flush","debounced","isInvoking","assignMergeValue","isArrayLikeObject","safeGet","toPlainObject","baseMergeDeep","srcIndex","mergeFunc","isCommon","isTyped","baseMerge","arrayIncludesWith","comparator","last","baseMap","flatMapDeep","fromPairs","pair","groupBy","groupBy$1","isEmpty","isEqual","kebabCase","kebabCase$1","merge$2","baseSome","some","createSet","createSet$1","baseUniq","includes","outer","computed","seenIndex","unionBy","unionBy$1","uniq","Chart","Modal","Model","Toolbar","ZoomBar","ZoomDomain","CanvasZoom","Axis","Area","WordCloud","Pie","Gauge","Bar","Boxplot","Scatter","Line","Radar","Tree","Treemap","Tooltip","Threshold","Legend","CirclePack","Alluvial","Meter","Heatmap","Choropleth","Events","RenderTypes","ChartTheme","ColorClassNameTypes","AxisPositions","ZoomBarTypes","TruncationTypes","CartesianOrientations","ScaleTypes","LegendPositions","Alignments","LegendOrientations","TreeTypes","LayoutDirection","LayoutGrowth","LayoutAlignItems","CalloutDirections","Skeletons","TextAnchor","DominantBaseline","GaugeTypes","ArrowDirections","Statuses","TickRotations","ChartTypes","ToolbarControlTypes","AxisTitleOrientations","LegendItemType","ColorLegendType","DividerStatus","AxisFlavor","Projection","carbonPrefix","canvasZoomSettings","circlePack","boxplot","legend","meter","radar","alluvial","heatmap","spacers","tooltips","transitions","zoomBar","defaultLegendAdditionalItems","debounceWithD3MousePosition","fn","holder","mergeDefaultChartOptions","defaultOptions","providedOptions","clonedDefaultOptions","providedAxesNames","_a","axisName","providedAxisOptions","identifier","scaleType","updateLegendAdditionalItems","getTranslationValues","elementRef","translateRegex","transformStr","transforms","getTransformOffsets","xyString","convertValueToPercentage","item","fullData","entireValue","percentage","accum","val","truncateLabel","fullText","truncationType","numCharacter","defaultAdditionalItems","getProperty","userProvidedAdditionalItems","providedTypes","defaultTypes","updatedDefaultItems","propPath","prop","flipSVGCoordinatesBasedOnOrientation","verticalCoordinates","orientation","generateSVGPathString","flipDomainAndRangeBasedOnOrientation","toDate","argument","argStr","constructFrom","addDays","amount","_date","addMonths","dayOfMonth","endOfDesiredMonth","daysInMonth","addMilliseconds","timestamp","millisecondsInWeek","millisecondsInDay","millisecondsInMinute","millisecondsInHour","addHours","getDefaultOptions","startOfWeek","weekStartsOn","_b","_d","_c","diff","startOfISOWeek","getISOWeekYear","fourthOfJanuaryOfNextYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","startOfDay","getTimezoneOffsetInMilliseconds","differenceInCalendarDays","dateLeft","dateRight","startOfDayLeft","startOfDayRight","timestampLeft","timestampRight","startOfISOWeekYear","fourthOfJanuary","addMinutes","addSeconds","addYears","compareAsc","_dateLeft","_dateRight","isDate","isValid","differenceInCalendarMonths","yearDiff","monthDiff","differenceInCalendarYears","differenceInDays","compareLocalAsc","difference","isLastDayNotFull","getRoundingMethod","method","differenceInMilliseconds","differenceInHours","differenceInMinutes","endOfDay","endOfMonth","isLastDayOfMonth","differenceInMonths","isLastMonthNotFull","differenceInSeconds","differenceInYears","isLastYearNotFull","startOfYear","cleanDate","formatDistanceLocale","formatDistance","token","tokenValue","buildFormatLongFn","dateFormats","timeFormats","dateTimeFormats","formatLong","formatRelativeLocale","formatRelative","_baseDate","_options","buildLocalizeFn","valuesArray","defaultWidth","eraValues","quarterValues","monthValues","dayValues","dayPeriodValues","formattingDayPeriodValues","localize","dirtyNumber","rem100","quarter","buildMatchFn","matchPattern","matchResult","matchedString","parsePatterns","findIndex","findKey","rest","buildMatchPatternFn","parseResult","matchOrdinalNumberPattern","parseOrdinalNumberPattern","matchEraPatterns","parseEraPatterns","matchQuarterPatterns","parseQuarterPatterns","matchMonthPatterns","parseMonthPatterns","matchDayPatterns","parseDayPatterns","matchDayPeriodPatterns","parseDayPeriodPatterns","enUS","getDayOfYear","getISOWeek","getWeekYear","firstWeekContainsDate","firstWeekOfNextYear","firstWeekOfThisYear","startOfWeekYear","firstWeek","getWeek","addLeadingZeros","targetLength","lightFormatters","signedYear","dayPeriodEnumValue","numberOfDigits","milliseconds","fractionalSeconds","dayPeriodEnum","formatters","era","signedWeekYear","weekYear","twoDigitYear","isoWeekYear","isoWeek","dayOfYear","dayOfWeek","localDayOfWeek","isoDayOfWeek","hours","_localize","timezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","formatTimezoneShort","delimiter","absOffset","minutes","dateLongFormatter","timeLongFormatter","longFormatters","datePattern","timePattern","dateTimeFormat","dayOfYearTokenRE","weekYearTokenRE","throwTokens","isProtectedDayOfYearToken","isProtectedWeekYearToken","warnOrThrowProtectedError","_message","message","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","formatStr","_f","_e","_h","_g","originalDate","parts","substring","firstCharacter","longFormatter","cleanEscapedString","formatterOptions","part","formatter","matched","subDays","subMonths","subHours","subMinutes","subSeconds","subYears","standardTruncationOptions","grid","ruler","baseTooltip","axes","timeScale","localeObject","isFullScreenEnabled","chart","thematicChart","axisChart","baseBarChart","simpleBarChart","groupedBarChart","stackedBarChart","boxplotChart","scatterChart","lollipopChart","lineChart","areaChart","stackedAreaChart","bubbleChart","chartSize","smallerChartDimension","bulletChart","histogramChart","wordCloudChart","pieChart","gaugeChart","donutChart","meterChart","proportionalMeterChart","radarChart","comboChart","treeChart","treemapChart","circlePackChart","alluvialChart","heatmapChart","choroplethChart","TimeIntervalNames","TIME_INTERVALS","isTickPrimary","allTicks","showDayName","isFirstTick","hasANewWeekStarted","isFirstQuarter","previousTick","isDayOfMonthChanged","isMonthChanged","isYearChanged","formatTick","timeScaleOptions","intervalConsideringAlsoShowDayNameOption","primary","secondary","formatString","getTimeformats","getConsecutiveDifferences","elements","elem","closestTimeIntervalName","duration","nearestIndex","deltaNearest","oldNearestSpan","currentSpan","computeTimeIntervalName","intervalOverride","differences","minDifference","H","previousTimestamp","currentMonth","previousMonth","formatDateTillMilliSeconds","_sanitizeCsvCell","cellContent","_trimmedCell","ChartModel","services","headers","cells","tableHeadingFormatter","tableCellFormatter","cartesianScales","domainScaleType","domainValueFormatter","allData","dataGroups","groupMapsTo","axesOptions","mapsTo","ACTIVE","legendConfigs","dataGroup","newData","sanitizedData","mainXPos","domainIdentifier","axisOptions","axisBins","histogramConfigs","areBinsDefined","d3Bin","binsWidth","binsDomain","groupsKeys","histogramData","aggregateDataByGroup","dataGroupNames","dataValuesGroupedByKeys","element","displayData","groupedData","groupName","stackKeys","axisPosition","dateA","dateB","binStart","binEnd","correspondingValues","correspondingBin","dataGroupName","binItem","correspondingDatum","rangeIdentifier","divergent","maxByKey","denominator","newState","configs","newConfig","newOptions","animate","changedLabel","DISABLED","hasDeactivatedItems","activeItems","indexToChange","updatedActiveItems","activeItem","defaultFilled","defaultFillColor","defaultStrokeColor","userProvidedScale","colorPairingTag","className","tabularData","datasets","labels","dataset","datasetLabel","correspondingLabel","updatedDatum","csvString","column","fileName","customFilename","uniqueDataGroups","getStatus","colorPairingOptions","numberOfVariants","pairingOption","colorPairingCounts","colorConfigs","numberOfColors","colorPairing","scaleOrdinal","resolveUrl","url","baseUrl","doc","uuid","counter","toArray","arrayLike","arr","styleProperty","getNodeWidth","leftBorder","rightBorder","getNodeHeight","topBorder","bottomBorder","getImageSize","targetNode","getPixelRatio","FINAL_PROCESS","canvasDimensionLimit","checkCanvasDimensions","canvas","createImage","img","svgToDataURL","html","nodeToDataURL","xmlns","foreignObject","isInstanceOfElement","instance","nodePrototype","formatCSSText","content","formatCSSProperties","getPseudoElementStyle","pseudo","cssText","clonePseudoElement","nativeNode","clonedNode","styleElement","clonePseudoElements","WOFF","JPEG","mimes","getExtension","getMimeType","extension","getContentFromDataUrl","dataURL","isDataUrl","makeDataUrl","mimeType","fetchAsDataURL","process","res","blob","reader","getCacheKey","contentType","includeQueryParams","resourceToDataURL","resourceUrl","cacheKey","msg","cloneCanvasElement","cloneVideoElement","video","ctx","poster","cloneIFrameElement","iframe","cloneNode","cloneSingleNode","isSlotElement","cloneChildren","deferred","clonedChild","cloneCSSStyle","targetStyle","sourceStyle","cloneInputValue","cloneSelectValue","clonedSelect","selectedOption","decorate","ensureSVGSymbols","uses","processedDefs","exist","ns","defs","isRoot","URL_REGEX","URL_WITH_FORMAT_REGEX","FONT_SRC_REGEX","toRegex","escaped","parseURLs","urls","raw","quotation","embed","resourceURL","baseURL","getContentFromUrl","resolvedURL","filterPreferredFontFormat","str","preferredFontFormat","src","shouldEmbed","embedResources","filteredCSSText","css","embedProp","propName","propValue","cssString","embedBackground","embedImageNode","isImageElement","image","embedChildren","deferreds","embedImages","applyStyle","manual","cssFetchCache","fetchCSS","embedFonts","regexUrl","loadFonts","loc","parseCSS","commentsRegex","keyframesRegex","matches","importRegex","combinedCSSRegex","unifiedRegex","getCSSRules","styleSheets","ret","sheet","importIndex","metadata","rule","inline","err","getWebFontRules","cssRules","parseWebFontRules","getWebFontCSS","rules","embedWebFonts","styleNode","sytleContent","toSvg","toCanvas","canvasWidth","canvasHeight","toPng","toJpeg","Service","model","newObj","CSS_VERIFIER_ELEMENT_CLASSNAME","DOMUtils","svgSelector","finalDimensions","validateAndSetDimensions","dimensions","dimensionKey","dimension","dimensionNumber","attrDimensions","svgElement","bbox","bboxDimensions","boundingRect","boundingRectDimensions","clientDimensions","nativeDimensions","query","querySections","elementToAppend","originalID","chartsprefix","mainContainer","holderElement","theme","holderSelection","dataUrl","isFullScreen","chartHeight","chartSVGSelector","childrenHeight","childSVG","containerWidth","containerHeight","resizeCallback","Component","chartprefix","oldParent","idSelector","container","chartClipId","chartClipRectSelection","setPrototypeOf","isFrozen","getPrototypeOf","getOwnPropertyDescriptor","freeze","seal","construct","fun","thisValue","Func","arrayForEach","unapply","arrayPop","stringToLowerCase","stringToString","stringMatch","stringReplace","stringIndexOf","stringTrim","regExpTest","typeErrorCreate","unconstruct","_len","_len2","_key2","addToSet","transformCaseFunc","lcElement","cleanArray","newObject","lookupGetter","desc","fallbackValue","html$1","svg$1","svgFilters","svgDisallowed","mathMl$1","mathMlDisallowed","mathMl","xml","MUSTACHE_EXPR","ERB_EXPR","TMPLIT_EXPR","DATA_ATTR","ARIA_ATTR","IS_ALLOWED_URI","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE","DOCTYPE_NAME","EXPRESSIONS","getGlobal","_createTrustedTypesPolicy","trustedTypes","purifyHostElement","ATTR_NAME","policyName","scriptUrl","createDOMPurify","DOMPurify","originalDocument","currentScript","DocumentFragment","HTMLTemplateElement","Element","NodeFilter","NamedNodeMap","HTMLFormElement","DOMParser","ElementPrototype","getNextSibling","getChildNodes","getParentNode","template","trustedTypesPolicy","emptyHTML","implementation","createNodeIterator","createDocumentFragment","getElementsByTagName","importNode","hooks","IS_ALLOWED_URI$1","ALLOWED_TAGS","DEFAULT_ALLOWED_TAGS","ALLOWED_ATTR","DEFAULT_ALLOWED_ATTR","CUSTOM_ELEMENT_HANDLING","FORBID_TAGS","FORBID_ATTR","ALLOW_ARIA_ATTR","ALLOW_DATA_ATTR","ALLOW_UNKNOWN_PROTOCOLS","ALLOW_SELF_CLOSE_IN_ATTR","SAFE_FOR_TEMPLATES","WHOLE_DOCUMENT","SET_CONFIG","FORCE_BODY","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_TRUSTED_TYPE","SANITIZE_DOM","SANITIZE_NAMED_PROPS","SANITIZE_NAMED_PROPS_PREFIX","KEEP_CONTENT","IN_PLACE","USE_PROFILES","FORBID_CONTENTS","DEFAULT_FORBID_CONTENTS","DATA_URI_TAGS","DEFAULT_DATA_URI_TAGS","URI_SAFE_ATTRIBUTES","DEFAULT_URI_SAFE_ATTRIBUTES","MATHML_NAMESPACE","SVG_NAMESPACE","HTML_NAMESPACE","NAMESPACE","IS_EMPTY_INPUT","ALLOWED_NAMESPACES","DEFAULT_ALLOWED_NAMESPACES","PARSER_MEDIA_TYPE","SUPPORTED_PARSER_MEDIA_TYPES","DEFAULT_PARSER_MEDIA_TYPE","CONFIG","formElement","isRegexOrFunction","testValue","_parseConfig","cfg","MATHML_TEXT_INTEGRATION_POINTS","HTML_INTEGRATION_POINTS","COMMON_SVG_AND_HTML_ELEMENTS","ALL_SVG_TAGS","ALL_MATHML_TAGS","_checkValidNamespace","tagName","parentTagName","_forceRemove","_removeAttribute","_initDocument","dirty","leadingWhitespace","dirtyPayload","body","_createNodeIterator","_isClobbered","elm","_isNode","_executeHook","entryPoint","currentNode","hook","_sanitizeElements","_isBasicCustomElement","parentNode","childNodes","childCount","expr","_isValidAttribute","lcTag","lcName","_sanitizeAttributes","attributes","hookEvent","attr","namespaceURI","attrValue","_sanitizeShadowDOM","fragment","shadowNode","shadowIterator","importedNode","returnNode","nodeIterator","serializedHTML","hookFunction","purify","sanitizeHtml","sanitizeSVG","svgContent","sanitizeText","_Toolbar","bodyOnClickHandler","buttonList","overflowMenuItemList","toolbarControls","button","enteringToolbarControls","overflowMenuControls","enteringOverflowMenuControls","show","currentItemIndex","previousItemIndex","previousItemNode","nextItemIndex","nextItemNode","overflowMenuItems","menuItem","keyEvent","control","numberOfIcons","controls","overflowSpecificControls","overflowList","controlConfig","controlType","isZoomBarEnabled","_LayoutComponent","component","growth","horizontal","updatedBoxes","itemComponent","isRenderingSVG","matchingElementDimensions","matchingElementWidth","elementWidth","allUpdatedBoxes","LayoutComponent","Spacer","spacerConfigs","settings","settings_1","_defineProperties","descriptor","_createClass","Constructor","protoProps","staticProps","_classCallCheck","_toConsumableArray","_arrayWithoutHoles","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","minLen","_arrayLikeToArray","iter","len","arr2","mixin","mixinfns","Class","mixinfn","_class","_typeof","obj","_inherits","subClass","superClass","_setPrototypeOf","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","Super","_getPrototypeOf","NewTarget","_possibleConstructorReturn","call","_assertThisInitialized","createComponent","ToMix","CreateComponent","_ToMix","_super","_this","_get","receiver","_superPropBase","handles","Handles","_this2","eventedState","EventedState","detail","eventNameSuffix","eventStart","fireOnNode","canceled","changeStateArgs","eventMatches","currentTarget","closest","getLaunchingDetails","evt","launchingElement","launchingEvent","eventedShowHideState","EventedShowHideState","evtOrElem","eventedShowHideState$1","initComponentByLauncher","InitComponentByLauncher","effectiveOptions","launcher","_mixin","focusWrapNode","handleTransitionEnd","transitionEnd","focusableItem","hasFocusin","focusinEventName","_this3","closeButton","CarbonModalComponent","tableArray","heading","Title","title","maxWidth","untruncatedTitle","tspanLength","titleString","substringIndex","Roles","legendOptions","alignment","legendOrientation","userProvidedOrder","legendItems","addedLegendItems","legendClickable","checkboxRadius","addedCheckboxes","allCheckboxes","status","additionalItemsOption","additionalItems","addedAdditionalItems","previousType","indexOfItem","additionalItem","legendOrder","dataA","dataB","definedOrderIndex","itemConfig","iconData","stroke","lineConfig","zoomEnter","truncationOptions","truncationThreshold","truncationNumCharacter","addedLegendItemsText","_sanitizedLabel","truncation","hoveredItem","hoveredItemData","clickedItemData","ChartClip","mainXScale","mainYScale","xScaleStart","xScaleEnd","yScaleEnd","yScaleStart","clipRect","CanvasChartClip","PLACEMENTS","defaultPositions","referenceOffset","referenceRect","windowRef","Position","positions","offsets","margins","targetRect","relativeRect","reference","placement","offsetFunction","targetBottom","targetRight","placements","containerFunction","positionFunction","weightedPlacements","pos","box","hiddenHeight","hiddenWidth","hiddenArea","visibleArea","visiblePercent","positionAt","defaultHTML","formattedItems","tooltipTextContainer","labelHTML","items","labelIconSize","label","valueFormatter","isTooltipEnabled","isTopZoomBarEnabled","mouseRelativePos","zoombarType","zoombarHeight","zoomBarConfigs","holderWidth","holderHeight","bestPlacementOption","horizontalOffset","tooltipConfigs","focal","canvasElements","zoomSettings","zoomLevel","eventType","eventDetail","newEvent","Files","filename","anchor","href","GradientUtils","lg","need3Stops","stops","Transitions","transitionConfigs","chartConfigs","serviceName","serviceObj","ChartEvents","pendingTransitions","promises","transitionID","graphFrameComponents","toolbarEnabled","legendComponent","isZoomEnabled","titleAvailable","titleComponent","toolbarComponent","headerComponent","graphFrameComponent","isLegendEnabled","fullFrameComponentDirection","legendPosition","legendSpacerComponent","fullFrameComponent","topLevelLayoutComponents","titleSpacerComponent","ChartModelCartesian","isDualAxes","scales","primaryDomain","primaryRange","secondaryDomain","secondaryRange","definedZoomBarData","newZoomBarData","zoomBarNormalizedValues","allDates","keysToCheck","axisPositionKey","axisMapsTo","AlluvialChartModel","justify","ascendingSourceBreadth","ascendingBreadth","ascendingTargetBreadth","defaultId","defaultNodes","graph","defaultLinks","nodeById","computeLinkBreadths","Sankey","linkSort","sankey","computeNodeLinks","computeNodeValues","computeNodeDepths","computeNodeHeights","computeNodeBreadths","sourceLinks","targetLinks","computeNodeLayers","columns","initializeNodeBreadths","reorderLinks","relaxRightToLeft","relaxLeftToRight","targetTop","reorderNodeLinks","resolveCollisions","sourceTop","resolveCollisionsBottomToTop","resolveCollisionsTopToBottom","curveHorizontal","horizontalSource","horizontalTarget","sankeyLinkHorizontal","isGradientAllowed","nodePadding","alluvialConfigs","nodeAlignment","sankeyJustify","sankeyLeft","sankeyRight","d3Sankey","nodeCoordinates","elementID","textWidth","gradient","textNode","debouncedLineHighlight","allLinks","hoveredElement","strokeColor","paths","nodeMatrix","titleContainer","titleMatrix","visited","AlluvialChart","_ChartBrush","frontSelectionArea","backdrop","brushArea","d3Selection","mainXScaleType","frontSelection","zoomDomain","updateSelectionDash","selectionWidth","dashArray","dashCount","totalRightDash","brushEventHandler","updateZoomDomain","startPoint","endPoint","xScale","scaleTime","newDomain","brushed","zoomRatio","clickedX","leftPoint","rightPoint","ChartBrush","isTopZoomBarLoading","isTopZoomBarLocked","highlight","axesLeftMargin","axesMargins","zoomBarData","defaultDomain","oldInitialZoomDomain","newInitialZoomDomain","startHighlight","endHighlight","labelMapTo","selected","brushEventListener","zoomBarEventType","handleWidth","handleHeight","handleXDiff","handleBarWidth","handleBarHeight","handleBarXDiff","handleYBarDiff","handleBars","querySelector","clipId","mainXAxisPosition","mainYAxisPosition","mainYScaleType","accessorFunction","xAccessor","yAccessor","areaGenerator","areaGraph","zoomBarClipPath","newDatum","startX","endX","skeletonClass","baselineGenerator","thresholdData","thresholdAxisGroups","thresholdAxisGroupsMerge","thresholdGroups","thresholdGroupsEnter","yScale","isScaleTypeLabels","getDomainValue","getRangeValue","getXValue","getYValue","fillColor","isVertical","formattedValue","Highlight","highlightData","highlightAxisGroups","highlightAxisGroupsMerge","highlightGroups","highlightGroupsEnter","highlightStartMapsTo","highlightEndMapsTo","labelMapsTo","AxisChartsTooltip","dualAxes","domainLabel","rangeLabel","domainValue","CartesianScales","domainAxisPosition","rangeAxisPosition","verticalAxesPositions","horizontalAxesPositions","domainAndRangeAxesPositions","possibleXAxisPositions","possibleYAxisPositions","scaledValue","spaceToAddToEdges","addSpacingToTimeDomain","addSpacingToContinuousDomain","axisConfigs","mainVerticalAxisOptions","mainHorizontalAxisOptions","mainVerticalScaleType","mainHorizontalScaleType","includeZero","extendLinearDomainBy","thresholds","ratioReference","ratioCompareTo","allDataValues","nonStackedGroupsData","stackedValues","dataValues","numericalValues","positiveSum","negativeSum","thresholdValue","scaleLog","scaleBand","scaleLinear","domainScale","highestThreshold","rangeScale","startDate","endDate","paddingRatio","newUpper","newLower","Curves","curveMonotoneX","curveMonotoneY","curveStepAfter","curveStepBefore","curveName","curveOptions","optionName","Zoom","customZoomBarData","allZoomBarData","customDomain","mergedConfigs","shouldUpdateRangeAxis","filteredData","currentZoomDomain","currentX0","currentX1","fullRange","gap","newX0","newX1","maxZoomDomain","currentZoomDomainPeriod","maxZoomDomainPeriod","minZoomRatio","AxisChart","zoomBarEnabled","isZoomBarLocked","zoomBarComponent","Grid","isXGridEnabled","isYGridEnabled","xGrid","mainXPosition","numberOfTicks","yGrid","mainYPosition","mousePos","gridlinesX","floor","ceiling","line1","line2","lineSpacing","gridElement","userSpecifiedThreshold","translations","backdropRect","areaConfigs","eventsFragment","boundsEnabled","upperBoundRangeValue","includeZeroInRangeValue","_domain","upperBound","lowerBound","isGradientEnabled","areas","chartMainContainer","strokePathElement","colorValue","sparklineColorObject","sparklineColorObjectKeys","enteringAreas","lineConfigs","events","curves","lineGenerator","groupData","THRESHOLD","pointIsWithinThreshold","Ruler","isRulerEnabled","tooltipData","mouseCoordinate","rulerLine","dataPointElements","pointsWithinLine","dataPointsMatchingRulerLine","currentValue","sampleAccumValue","distanceToCurrentValue","distanceToAccumValue","domainValuesMatchingRulerLine","elementsToHighlight","sampleMatch","mouseMoveCallback","debounceThreshold","mousePosition","fadeInOnChartHolderMouseover","scatterData","circlesToStyle","handleThresholds","xThreshold","yThreshold","xValue","yValue","filled","fillOpacity","classNamesNeeded","isFilled","isAxisVisible","startPosition","endPosition","axisFunction","axisRefExists","axisRef","invisibleAxisRef","isTimeScaleType","isVerticalAxis","axisScaleType","isDataLoading","numberOfTicksProvided","userProvidedTickValues","isNumberOfTicksProvided","fakeTick","fakeTickText","tickHeight","addSpaceOnEdges","tempScale","userProvidedFormatter","defaultFormattedValue","validTicks","userProvidedTickValue","tickTimestamp","discreteDomain","isDataEmpty","axisTitleRef","titleOrientation","titleHeight","axisRefSelection","shouldRotateTicks","tickRotation","mockTextPiece","averageLetterWidth","lastStartPosition","xTransformation","axisTickLabels","tick_html","tickSize","spaceRatio","numberOfTicksFit","HoverAxis","rectangle","TwoDimensionalAxes","axisPositions","axisComponent","childKey","marginKey","Skeleton","showShimmerEffect","xRange","yRange","ticksNumber","ticksValues","xGridG","yGridG","shimmer","arcPathGenerator","tcx","pieConfigs","tcy","skeletonAreaShape","gradientId","stopBgShimmerClass","stopShimmerClass","linearGradient","repeat","easeLinear","AreaChart","BoxplotChartModel","boxplotData","record","q3","iqr","irq1","irq3","outliers","normalValues","minNormalValue","maxNormalValue","isInVerticalOrientation","gridSize","boxWidth","boxGroups","boxGroupsEnter","allBoxGroups","boxplotConfigs","outlier","circlesEnter","ZeroLine","minDomainValue","maxDomainValue","drawZeroLine","yPosition","lineCoordinates","BoxplotChart","Bubble","radiusMapsTo","allRadii","radiusDataIsValid","radiusScale","bubbleOptions","BubbleChart","BulletChartModel","matchingRangeIndex","performanceAreaTitles","Bullet","rangeScaleStart","rangeScaleEnd","rangeScaleDomainMax","renderRangeBoxes","rangeBoxData","rangeBoxes","renderBars","bars","renderTargetLines","renderTargetQuartiles","quartilesData","barValue","lineHeight","BulletChart","getDomain","limits","getColorScale","colorOptions","customColors","customColorsEnabled","colorPairingOption","colorScheme","colorGroupingLength","scaleQuantize","ChoroplethModel","country","feature","topology","properties","transformPoint","stitch","stitchedArcs","fragmentByStart","fragmentByEnd","fragments","emptyIndex","ends","fg","gf","dp","planarRingArea","mergeArcs","objects","polygonsByArc","polygons","extract","neighbors","ki","BinnedRuler","correspondingDomainValue","sampleMatchData","activeDataGroupNames","tooltipDataGroups","rulerPosition","StackedRuler","ColorScaleLegend","xDimensions","availableSpace","colorScaleType","useDefaultBarWidth","barWidth","legendGroupElement","axisElement","legendTitleGroup","quant","linearScale","legendAxis","rangeStart","stopLengthPercentage","colorScaleBand","MeterTitle","titleElement","datasetsTotal","total","breakdownFormatter","totalValue","totalFormatter","totalString","containerBounds","meterConfigs","statusGroup","icon","innerIcon","dataValue","tspan","proportional","totalWidth","percentageWidth","statusWidth","numberOfDatapoints","chartWidth","spacingFactor","circlePackConfigs","hierarchyLevel","canvasZoomEnabled","d3Hierarchy","nodeData","enteringCircles","originalClass","childData","chartSvg","canvasSelection","disabled","zoomable","childrenData","parentValue","arcTween","arcFunc","valueMapsTo","pieLayoutData","renderLabels","labelData","enteringLabels","calloutData","marginedRadius","deg","textLength","totalSlices","sliceAngleDeg","labelTranslateX","labelTranslateY","xOffset","yOffset","pieTranslateX","pieTranslateY","callouts","enteringCallouts","xPosition","Donut","donutTitle","d3Ref","donutCenterFigure","interpolateFunction","numberFormatter","ARROW_UP_PATH_STRING","ARROW_DOWN_PATH_STRING","arcSize","valueRatio","rotationAngle","currentAngle","arcValue","gaugeTranslateX","arcType","valueFontSize","deltaFontSize","numberSpacing","showPercentageSymbol","numbersYPosition","numbersGroup","fontSize","valueNumberGroup","valueNumber","valueNumberWidth","symbolFontSize","gaugeSymbol","symbolWidth","symbolHeight","arrowSize","deltaGroup","deltaNumber","deltaNumberWidth","arrowEnabled","deltaArrow","deltaArrowSelection","arcWidth","GroupedBar","allDataLabels","barGroups","allBarGroups","translateBy","rangeAxis","zoomx0","zoomx1","activeData","totalGroupPadding","ref","providedWidth","providedMaxWidth","numOfActiveDataGroups","ranges","domains","minimum","maximum","uniqueDomain","uniqueRange","matrixArray","patternID","rectangles","parentTag","xBandwidth","yBandwidth","dividerStatus","heatmapConfigs","totalLabel","cell","nullState","Histogram","groupIdentifier","binnedStackedData","rangeScaleLabel","Lollipop","allLines","prevX","domainMax","stackedData","userProvidedHeight","valued","peakValue","peakData","peak","radialLabelPlacement","angleRadians","mod","radToDeg","isInRange","rad","polarToCartesianCoords","distanceBetweenPointOnCircAndVerticalDiameter","tmpTick","tmpTickText","completeBlankData","radarConfigs","xLabelPadding","yLabelPadding","yTicksNumber","minRange","xAxisRectHeight","margin","centerPointMinValue","yTicks","colorScale","radialLineGenerator","horizSpaceNeededByEachXLabel","tickWidth","distanceFromDiameter","yAxisUpdate","shapeData","alignmentXOffset","selectionUpdate","svgDimensions","alignmentOffset","axisLine","dots","itemsToHighlight","SimpleBar","yScaleDomainStart","SkeletonLines","isSparkline","sparklineSkeleton","StackedArea","StackedBar","stackData","barIsNegative","matchingDataPoint","numberOfDomainValues","StackedScatter","circleGroups","hoveredX","hoveredY","groupDataIndex","dataIndex","rangeValue","stackedRangeValue","datapoint","tooltipDatapoint","NODE_OFFSET","longestLabel","longestLabelInChildren","mockLabel","mockLabelWidth","rootTitle","mockRootTitleWidth","mockLongestLabelWidth","updateHeight","nodeGroups","nodeGroup","nodeGroupsEnter","linkPaths","linkGroup","linkPathsEnter","diagonal","descendants","black","white","yellow10","yellow20","yellow30","yellow40","yellow50","yellow60","yellow70","yellow80","yellow90","yellow100","yellow","orange10","orange20","orange30","orange40","orange50","orange60","orange70","orange80","orange90","orange100","orange","red10","red20","red30","red40","red50","red60","red70","red80","red90","red100","red","magenta10","magenta20","magenta30","magenta40","magenta50","magenta60","magenta70","magenta80","magenta90","magenta100","magenta","purple10","purple20","purple30","purple40","purple50","purple60","purple70","purple80","purple90","purple100","purple","blue10","blue20","blue30","blue40","blue50","blue60","blue70","blue80","blue90","blue100","blue","cyan10","cyan20","cyan30","cyan40","cyan50","cyan60","cyan70","cyan80","cyan90","cyan100","cyan","teal10","teal20","teal30","teal40","teal50","teal60","teal70","teal80","teal90","teal100","teal","green10","green20","green30","green40","green50","green60","green70","green80","green90","green100","green","coolGray10","coolGray20","coolGray30","coolGray40","coolGray50","coolGray60","coolGray70","coolGray80","coolGray90","coolGray100","coolGray","gray10","gray20","gray30","gray40","gray50","gray60","gray70","gray80","gray90","gray100","gray","warmGray10","warmGray20","warmGray30","warmGray40","warmGray50","warmGray60","warmGray70","warmGray80","warmGray90","warmGray100","warmGray","colors","findColorShade","colorName","colorShades","colorShadeLevel","textFillColor","correspondingLeaf","correspondingLeafFill","cl","d3Color","colorShade","lightness","uidCounter","windowLocation","leafGroups","leaf","allLeafGroups","rects","leafID","addedText","clipPathID","customColor","RADIANS","SPIRALS","archimedeanSpiral","rectangularSpiral","ch","d3Cloud","cloudText","font","cloudFont","cloudFontSize","fontStyle","cloudFontNormal","fontWeight","cloudRotate","cloudPadding","spiral","cloud","cloudCanvas","functor","contextAndRatio","getContext","board","zeroArray","tags","cloudSprite","cloudBounds","startY","maxDelta","dt","dxdy","collideRects","cloudCollide","sprite","sw","lx","msx","di","maxh","metrics","sr","wcr","wsr","hcr","hsr","pixels","w32","seenRow","fontSizeScale","fontSizeMapsTo","wordMapsTo","layout","draw","textGroup","allText","allOccurences","sizeDataIsValid","debouncedHighlight","allWords","GeoProjection","geoData","withData","withoutData","withoutDataMerge","json","projectionScale","geo","missingBorders","Events.Choropleth","Events.Tooltip","ExperimentalChoroplethChart","configOptions","CirclePackChartModel","zoomOptions","userProvidedDepth","depthOne","totalSum","grandParent","parentWithinIteration","CirclePackChart","graphComponentsMap","ComboChart","chartOptions","comboChartTypes","graphComponents","stackedRulerEnabled","chartObject","PieChartModel","PieChart","extending","DonutChart","GaugeChartModel","GaugeChart","GroupedBarChart","HeatmapModel","ran","dom","HeatmapChart","ChartModelBinned","HistogramChart","LineChart","LollipopChart","MeterChartModel","boundedValue","allRanges","MeterChart","meterComponents","graphFrame","RadarChartModel","additionalHeaders","RadarChart","ScatterChart","TreeChartModel","TreeChart","TreemapChartModel","TreemapChart","SimpleBarChart","StackedAreaChart","StackedBarChart","WordCloudModel","WordCloudChart"],"mappings":"kOAAe,SAASA,GAAUC,EAAGC,EAAG,CACtC,OAAOD,GAAK,MAAQC,GAAK,KAAO,IAAMD,EAAIC,EAAI,GAAKD,EAAIC,EAAI,EAAID,GAAKC,EAAI,EAAI,GAC9E,CCFe,SAASC,GAAWF,EAAGC,EAAG,CACvC,OAAOD,GAAK,MAAQC,GAAK,KAAO,IAC5BA,EAAID,EAAI,GACRC,EAAID,EAAI,EACRC,GAAKD,EAAI,EACT,GACN,CCHe,SAASG,GAASC,EAAG,CAClC,IAAIC,EAAUC,EAAUC,EAOpBH,EAAE,SAAW,GACfC,EAAWN,GACXO,EAAW,CAACE,EAAGC,IAAMV,GAAUK,EAAEI,CAAC,EAAGC,CAAC,EACtCF,EAAQ,CAACC,EAAGC,IAAML,EAAEI,CAAC,EAAIC,IAEzBJ,EAAWD,IAAML,IAAaK,IAAMF,GAAaE,EAAIM,GACrDJ,EAAW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AE,eAAAiuH,EAAgB,WAAAC,GAAeluH,EAAQ,UACzC,CAAE,YAAAwnE,CAAY,EAAIxnE,EAAQ,KAC1B+mE,EAAU,CAAC/mE,EAAQ,QAAQ,UAAW,QAASA,EAAQ,QAAQ,UAAU,EACzEgnE,EAAQ,CACb,GAAG+B,EAAY,IAAK3vE,GAAe,CAClCA,EAAM80H,CAAU,EAChB90H,EAAMouE,CAAW,EACjBpuE,EAAM60H,CAAc,CAAA,CACpB,CAAA,EAGF,OAAO,MAAM,YAAY,CAAE,QAAAlnD,EAAS,MAAAC,CAAO,CAAA,CAC5C,CACD,CCfO,MAAMwrD,WAAuBzkE,EAAM,CAGzC,YAAY2E,EAAwByhC,EAAmD,CACtF,MAAMzhC,EAAQyhC,CAAY,EAHnB,KAAA,MAAA,IAAIo+B,GAAe,KAAK,QAAQ,EAOvC,KAAK,MAAM,WAAW5/D,GAAyB3yD,GAAQ,eAAgBm0F,EAAa,OAAO,CAAC,EAGvF,KAAA,KAAKzhC,EAAQyhC,CAAY,CAC/B,CAEA,eAAgB,CAEf,MAAMO,EAAoC,CACzC,IAAIlmC,GAAU,KAAK,MAAO,KAAK,QAAQ,EACvC,IAAIw9C,GAAS,KAAK,MAAO,KAAK,SAAU,CACvC,SAAUr7C,GAAU,GAAA,CACpB,CAAA,EAKK,OADyB,KAAK,mBAAmB+jC,CAAoB,CAE7E,CACD","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,562,563,564,565,566,567,568,569,570,571,575,580,581,582,583,584,585,586,587,588,589,590,597,607,608,609,610,611,612,613,614,615,616,617,618,651,652,653,654,655,656,679,681,682]}